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

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

From:
jkeenan
Date:
December 7, 2008 08:15
Subject:
[svn:parrot] r33616 - branches/testparrottest/t/perl
Message ID:
20081207161522.EDF75CBB6B@x12.develooper.com
Author: jkeenan
Date: Sun Dec  7 08:15:21 2008
New Revision: 33616

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

Log:
Add tests for example_output* test functions.

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 08:15:21 2008
@@ -30,7 +30,7 @@
         plan( skip_all => "Test::Builder::Tester not installed\n" );
         exit 0;
     }
-    plan( tests => 106 );
+    plan( tests => 112 );
 }
 
 use lib qw( . lib ../lib ../../lib );
@@ -358,6 +358,34 @@
 /noop\s+bend/s
 OUT
 
+my $file = q{t/perl/testlib/hello.pasm};
+my $expected = qq{Hello World\n};
+example_output_is( $file, $expected );
+
+$expected = qq{Goodbye World\n};
+example_output_isnt( $file, $expected );
+
+$expected = qr{Hello World};
+example_output_like( $file, $expected );
+
+$file = q{t/perl/testlib/answer.pir};
+$expected = <<EXPECTED;
+The answer is
+42
+says Parrot!
+EXPECTED
+example_output_is( $file, $expected );
+
+$expected = <<EXPECTED;
+The answer is
+769
+says Parrot!
+EXPECTED
+example_output_isnt( $file, $expected );
+
+$expected = qr/answer.*42.*Parrot!/s;
+example_output_like( $file, $expected );
+
 ##### 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