[svn:parrot] r42812 - trunk/t/compilers/pge

mikehh at svn.parrot.org mikehh at svn.parrot.org
Thu Nov 26 19:26:25 UTC 2009


Author: mikehh
Date: Thu Nov 26 19:26:25 2009
New Revision: 42812
URL: https://trac.parrot.org/parrot/changeset/42812

Log:
convert test to pir - from patch by bubaflub++ (TT #1335)

Modified:
   trunk/t/compilers/pge/04-compile.t

Modified: trunk/t/compilers/pge/04-compile.t
==============================================================================
--- trunk/t/compilers/pge/04-compile.t	Thu Nov 26 18:51:52 2009	(r42811)
+++ trunk/t/compilers/pge/04-compile.t	Thu Nov 26 19:26:25 2009	(r42812)
@@ -1,13 +1,7 @@
-#! perl
+#!parrot
 # $Id$
 
-# Copyright (C) 2007, Parrot Foundation.
-
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib ../../../lib );
-use Test::More;
-use Parrot::Test tests => 4;
+# Copyright (C) 2007-2009, Parrot Foundation.
 
 =head1 NAME
 
@@ -23,73 +17,69 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'basic compile, no name/grammar' );
 .namespace []
 
 .sub main :main
+    .include 'test_more.pir'
+    plan(4)
+
+    test_basic_compile_no_name_grammar()
+    test_compile_into_current_namespace()
+    test_compile_into_a_new_grammar()
+    test_compile_into_a_new_grammar_2x()
+.end
+
+
+.sub test_basic_compile_no_name_grammar
     load_bytecode 'PGE.pbc'
 
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
     $P1 = p6compiler('.+')
     $P2 = $P1('ok 1')
-    say $P2
+    is($P2, 'ok 1', 'basic compile, no name/grammar')
 .end
-CODE
-ok 1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'compile into current namespace' );
-.namespace []
 
-.sub main :main
+.sub test_compile_into_current_namespace
     load_bytecode 'PGE.pbc'
 
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
     $P1 = p6compiler('.+', 'name'=>'xyz', 'grammar'=>'')
     $P2 = 'xyz'('ok 1')
-    say $P2
+    is($P2, 'ok 1', 'compile into current namespace')
 .end
-CODE
-ok 1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'compile into a new grammar' );
-.sub main :main
+
+.sub test_compile_into_a_new_grammar
     load_bytecode 'PGE.pbc'
 
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
-    $P1 = p6compiler('.+', 'name'=>'xyz', 'grammar'=>'PGE::Test')
-    $P2 = get_hll_global ['PGE';'Test'], 'xyz'
+    $P1 = p6compiler('.+', 'name'=>'xyz1', 'grammar'=>'PGE::Test')
+    $P2 = get_hll_global ['PGE';'Test'], 'xyz1'
     $P3 = $P2('ok 1')
-    say $P3
+    is($P3, 'ok 1', 'compile into a new grammar')
 .end
-CODE
-ok 1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'compile into a new grammar, 2x' );
-.sub main :main
+
+.sub test_compile_into_a_new_grammar_2x
     load_bytecode 'PGE.pbc'
 
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
     $P1 = p6compiler('.+', 'name'=>'abc', 'grammar'=>'PGE::Test')
-    $P1 = p6compiler('.+', 'name'=>'xyz', 'grammar'=>'PGE::Test')
+    $P1 = p6compiler('.+', 'name'=>'xyz2', 'grammar'=>'PGE::Test')
     $P2 = get_hll_global ['PGE';'Test'], 'abc'
     $P3 = $P2('ok 1')
-    say $P3
+    is($P3, 'ok 1', 'compile into a new grammar, 2x')
 .end
-CODE
-ok 1
-OUTPUT
+
 
 # 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