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

[svn:parrot] r33609 - branches/testparrottest/t/perl

From:
jkeenan
Date:
December 7, 2008 07:37
Subject:
[svn:parrot] r33609 - branches/testparrottest/t/perl
Message ID:
20081207153746.0D875CB9AF@x12.develooper.com
Author: jkeenan
Date: Sun Dec  7 07:37:45 2008
New Revision: 33609

Modified:
   branches/testparrottest/t/perl/Parrot_Test.t

Log:
Add tests for pir_2_pasm.

Modified: branches/testparrottest/t/perl/Parrot_Test.t
==============================================================================
--- branches/testparrottest/t/perl/Parrot_Test.t	(original)
+++ branches/testparrottest/t/perl/Parrot_Test.t	Sun Dec  7 07:37:45 2008
@@ -30,7 +30,7 @@
         plan( skip_all => "Test::Builder::Tester not installed\n" );
         exit 0;
     }
-    plan( tests => 102 );
+    plan( tests => 106 );
 }
 
 use lib qw( . lib ../lib ../../lib );
@@ -319,6 +319,45 @@
     test_test($desc);
 }
 
+##### PIR-to-PASM output test functions #####
+
+my $pir_2_pasm_code = <<'ENDOFCODE';
+.sub _test
+   noop
+   end
+.end
+ENDOFCODE
+
+pir_2_pasm_is( <<CODE, <<'OUT', "pir_2_pasm:  added return - end" );
+$pir_2_pasm_code
+CODE
+# IMCC does produce b0rken PASM files
+# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
+_test:
+  noop
+  end
+OUT
+
+pir_2_pasm_isnt( <<CODE, <<'OUT', "pir_2_pasm:  added return - end" );
+$pir_2_pasm_code
+CODE
+_test:
+  noop
+  bend
+OUT
+
+pir_2_pasm_like( <<CODE, <<'OUT', "pir_2_pasm:  added return - end" );
+$pir_2_pasm_code
+CODE
+/noop\s+end/s
+OUT
+
+pir_2_pasm_unlike( <<CODE, <<'OUT', "pir_2_pasm:  added return - end" );
+$pir_2_pasm_code
+CODE
+/noop\s+bend/s
+OUT
+
 ##### C-output test functions #####
 
 my $c_code = <<'ENDOFCODE';



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