Author: jkeenan
Date: Mon Dec 1 16:36:31 2008
New Revision: 33434
Modified:
branches/testparrottest/lib/Parrot/Test.pm
branches/testparrottest/t/perl/Parrot_Test.t
Log:
Add a basic test for Parrot::Test::run_command(). chromatic++ for testing
suggestion.
Modified: branches/testparrottest/lib/Parrot/Test.pm
==============================================================================
--- branches/testparrottest/lib/Parrot/Test.pm (original)
+++ branches/testparrottest/lib/Parrot/Test.pm Mon Dec 1 16:36:31 2008
@@ -305,7 +305,6 @@
my ( $out, $err, $chdir ) = _handle_test_options( \%options );;
-# local $ENV;
if ($PConfig{parrot_is_shared}) {
_handle_blib_path();
}
Modified: branches/testparrottest/t/perl/Parrot_Test.t
==============================================================================
--- branches/testparrottest/t/perl/Parrot_Test.t (original)
+++ branches/testparrottest/t/perl/Parrot_Test.t Mon Dec 1 16:36:31 2008
@@ -30,7 +30,7 @@
plan( skip_all => "Test::Builder::Tester not installed\n" );
exit 0;
}
- plan( tests => 94 );
+ plan( tests => 96 );
}
use lib qw( . lib ../lib ../../lib );
@@ -463,6 +463,24 @@
is( $exit_message, 2, "Got expected exit message" );
}
+{
+ my $text = q{Hello, world};
+ my $cmd = "$^X -e 'print qq{$text\n};'";
+ my $exit_message;
+ my ($stdout, $stderr);
+ capture(
+ sub {
+ $exit_message = run_command(
+ $cmd,
+ 'CD' => '',
+ ); },
+ \$stdout,
+ \$stderr,
+ );
+ like($stdout, qr/$text/, "Captured STDOUT");
+ is($exit_message, 0, "Got 0 as exit message");
+}
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4