[svn:parrot] r43194 - trunk/t/compilers/tge

bubaflub at svn.parrot.org bubaflub at svn.parrot.org
Tue Dec 22 05:32:02 UTC 2009


Author: bubaflub
Date: Tue Dec 22 05:32:02 2009
New Revision: 43194
URL: https://trac.parrot.org/parrot/changeset/43194

Log:
convert t/compilers/tge/basic.t to PIR

Modified:
   trunk/t/compilers/tge/basic.t

Modified: trunk/t/compilers/tge/basic.t
==============================================================================
--- trunk/t/compilers/tge/basic.t	Tue Dec 22 05:28:31 2009	(r43193)
+++ trunk/t/compilers/tge/basic.t	Tue Dec 22 05:32:02 2009	(r43194)
@@ -1,13 +1,7 @@
-#!perl
+#!parrot
 # Copyright (C) 2005-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw(t . lib ../lib ../../lib ../../../lib);
-use Test::More;
-use Parrot::Test tests => 3;
-
 =head1 NAME
 
 t/basic.t
@@ -22,9 +16,16 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUT', 'build up a basic rule in a grammar' );
+.sub main :main
+    .include 'test_more.pir'
+     plan(11)
+
+     test_build_up_a_basic_rule_in_a_grammar()
+     test_agid_hash()
+     test_malformed_string_in_r11890_under_linux_i386()
+.end
 
-.sub _main :main
+.sub test_build_up_a_basic_rule_in_a_grammar
     load_bytecode 'TGE.pbc'
 
     .local pmc AG
@@ -35,25 +36,14 @@
     .local pmc rule_obj
     rule_obj = $P1[0]
     $P2 = getattribute rule_obj, 'type'
-    print $P2
-    print "\n"
+    is($P2, 'Leaf', 'build up a basic rule in a grammar')
     $P3 = getattribute rule_obj, 'name'
-    print $P3
-    print "\n"
+    is($P3, 'min', 'build up a basic rule in a grammar')
     $P4 = getattribute rule_obj, 'parent'
-    print $P4
-    print "\n"
-    end
+    is($P4, '.', 'build up a basic rule in a grammar')
 .end
 
-CODE
-Leaf
-min
-.
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', 'agid hash' );
-.sub _main :main
+.sub test_agid_hash
     load_bytecode 'TGE.pbc'
     .local pmc tree
     tree = new ['TGE';'Tree']
@@ -61,54 +51,34 @@
 
     $P0 = new 'Integer'
     id = tree.'_lookup_id'($P0)
-    print id
-    print "\n"
+    is(id, 1, 'agid hash')
     $P1 = new 'Integer'
     id = tree.'_lookup_id'($P1)
-    print id
-    print "\n"
+    is(id, 2, 'agid hash')
     id = tree.'_lookup_id'($P0)
-    print id
-    print "\n"
+    is(id, 1, 'agid hash')
     $P2 = new 'Integer'
     id = tree.'_lookup_id'($P2)
-    print id
-    print "\n"
+    is(id, 3, 'agid hash')
     id = tree.'_lookup_id'($P0)
-    print id
-    print "\n"
+    is(id, 1, 'agid hash')
     id = tree.'_lookup_id'($P1)
-    print id
-    print "\n"
+    is(id, 2, 'agid hash')
     id = tree.'_lookup_id'($P2)
-    print id
-    print "\n"
-    end
+    is(id, 3, 'agid hash')
 .end
 
-CODE
-1
-2
-1
-3
-1
-2
-3
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', '"Malformed string" in r11890 under Linux i386' );
-
-.sub test
-  load_bytecode "TGE.pbc"
-  print "1\n"
+.sub test_malformed_string_in_r11890_under_linux_i386
+    lives_ok(<<'CODE', '"Malformed string" in r11890 under Linux i386')
+.sub main 
+    load_bytecode "TGE.pbc"
 .end
 CODE
-1
-OUT
+.end
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:


More information about the parrot-commits mailing list