develooper Front page | perl.cvs.parrot | Postings from November 2008

[svn:parrot] r32634 - trunk/t/oo

From:
bernhard
Date:
November 14, 2008 03:46
Subject:
[svn:parrot] r32634 - trunk/t/oo
Message ID:
20081114114647.6D7B1CB9AF@x12.develooper.com
Author: bernhard
Date: Fri Nov 14 03:46:45 2008
New Revision: 32634

Modified:
   trunk/t/oo/names.t

Log:
RT#60512: [PATCH] rewrite of names.t to PIR
Courtesy of Bruce Stockwell


Modified: trunk/t/oo/names.t
==============================================================================
--- trunk/t/oo/names.t	(original)
+++ trunk/t/oo/names.t	Fri Nov 14 03:46:45 2008
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2007, The Perl Foundation.
+#! parrot
+# Copyright (C) 2007-2008, The Perl Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 1;
-
 =head1 NAME
 
 t/oo/names.t - Test OO name-related items
@@ -22,33 +16,42 @@
 
 =cut
 
-pir_output_is(
-    <<'CODE', <<'OUT', 'Create HLL class same-named as Parrot class', todo => 'RT #43419' );
-    .HLL "perl6", ""
-
-    .namespace []
-
-    .sub main :main
-        # works
-        $P0 = new 'Class'
-        $P0.'name'('AnObject')
-        $S0 = $P0
-        say $S0
-
-        # fails
-        $P0 = new 'Class'
-        $P0.'name'('Object')
-        $S0 = $P0
-        say $S0
-    .end
-CODE
-perl6;AnObject
-perl6;Object
-OUT
+.HLL "perl6", ""
+
+.namespace []
+
+.sub main :main
+    .include 'include/test_more.pir'
+
+    plan(2)
+
+    hll_object_different_than_parrot_name()
+    hll_object_same_as_parrot_name()
+.end
+
+.sub hll_object_different_than_parrot_name
+    # works
+    $P0 = new 'Class'
+    $P0.'name'('AnObject')
+    $S0 = $P0
+    is ($S0, 'AnObject','HLL obj w/ name different than parrot obj created')
+.end
+
+.sub hll_object_same_as_parrot_name
+    # fails
+    $P0 = new 'Class'
+    push_eh OK_1
+    $P0.'name'('Object')
+    pop_eh
+    $S0 = $P0
+    ok (0, 'HLL obj created w/ same name as parrot obj')
+    .return()
+OK_1:    
+    ok (1, 'HLL obj w/ same name as parrot obj not created')
+.end
 
 # Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
+#   mode: pir 
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About