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

mikehh at svn.parrot.org mikehh at svn.parrot.org
Thu Nov 26 18:51:52 UTC 2009


Author: mikehh
Date: Thu Nov 26 18:51:52 2009
New Revision: 42811
URL: https://trac.parrot.org/parrot/changeset/42811

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

Modified:
   trunk/t/compilers/pge/02-match.t

Modified: trunk/t/compilers/pge/02-match.t
==============================================================================
--- trunk/t/compilers/pge/02-match.t	Thu Nov 26 18:07:04 2009	(r42810)
+++ trunk/t/compilers/pge/02-match.t	Thu Nov 26 18:51:52 2009	(r42811)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2006-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2006-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
 t/compilers/pge/02-match.t - test the Match class
@@ -23,30 +17,31 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'concat on a Match object (rt#39135)' );
 .sub main :main
+    .include 'test_more.pir'
+    plan(4)
+
+    test_concat_on_a_match_object()
+    test_push_on_a_match_object()
+.end
+
+.sub test_concat_on_a_match_object
     load_bytecode 'PGE.pbc'
 
     $P0 = compreg 'PGE::Perl6Regex'
     $P1 = $P0('.+')
     $P2 = $P1('world')
 
-    say $P2              # world
+    is($P2, 'world', 'concat on a Match object (rt#39135)')
 
     $P3 = new 'String'
     $P3 = 'hello '
 
     $P4 = concat $P3, $P2
-    say $P4              # hello world
+    is($P4, 'hello world', 'concat on a Match object (rt#39135)')
 .end
 
-CODE
-world
-hello world
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'push on a Match object' );
-.sub main :main
+.sub test_push_on_a_match_object
     .local pmc match, str, arr
     load_bytecode 'PGE.pbc'
     match = new ['PGE';'Match']
@@ -55,19 +50,14 @@
     push match, str
     arr = match.'list'()
     $I0 = elements arr
-    print $I0
-    print "\n"
+    is($I0, 1, 'push on a Match object')
     $P3 = match[0]
-    say $P3
+    is($P3, 'foo', 'push on a Match object')
 .end
-CODE
-1
-foo
-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