diff options
author | Steve Peters <steve@fisharerojo.org> | 2008-02-29 04:39:18 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2008-02-29 04:39:18 +0000 |
commit | 04955c1432b0be1ddb216b8c8dce2058e6337802 (patch) | |
tree | 9c24cb40408a987b8bca6baff517c78d0085f73a /t/lib | |
parent | 2a7f4b9b0713cc512aacba1593d634a47060e42e (diff) | |
download | perl-04955c1432b0be1ddb216b8c8dce2058e6337802.tar.gz |
Upgrade to Test-Simple-0.78
p4raw-id: //depot/perl@33394
Diffstat (limited to 't/lib')
-rw-r--r-- | t/lib/Test/Simple/sample_tests/death.plx | 6 | ||||
-rw-r--r-- | t/lib/Test/Simple/sample_tests/death_with_handler.plx | 18 | ||||
-rw-r--r-- | t/lib/Test/Simple/sample_tests/last_minute_death.plx | 6 |
3 files changed, 26 insertions, 4 deletions
diff --git a/t/lib/Test/Simple/sample_tests/death.plx b/t/lib/Test/Simple/sample_tests/death.plx index ef4ba8c188..493784c0cd 100644 --- a/t/lib/Test/Simple/sample_tests/death.plx +++ b/t/lib/Test/Simple/sample_tests/death.plx @@ -4,10 +4,12 @@ push @INC, 't/lib'; require Test::Simple::Catch; my($out, $err) = Test::Simple::Catch::caught(); +require Dev::Null; + Test::Simple->import(tests => 5); -close STDERR; +tie *STDERR, 'Dev::Null'; ok(1); ok(1); ok(1); -die "Knife?"; +die "This is a test"; diff --git a/t/lib/Test/Simple/sample_tests/death_with_handler.plx b/t/lib/Test/Simple/sample_tests/death_with_handler.plx new file mode 100644 index 0000000000..2009a0e2dd --- /dev/null +++ b/t/lib/Test/Simple/sample_tests/death_with_handler.plx @@ -0,0 +1,18 @@ +require Test::Simple; + +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); + +Test::Simple->import(tests => 2); + +# Test we still get the right exit code despite having a die +# handler. +$SIG{__DIE__} = sub {}; + +require Dev::Null; +tie *STDERR, 'Dev::Null'; + +ok(1); +ok(1); +die "This is a test"; diff --git a/t/lib/Test/Simple/sample_tests/last_minute_death.plx b/t/lib/Test/Simple/sample_tests/last_minute_death.plx index ef86a63c51..fe8451edfd 100644 --- a/t/lib/Test/Simple/sample_tests/last_minute_death.plx +++ b/t/lib/Test/Simple/sample_tests/last_minute_death.plx @@ -5,7 +5,9 @@ require Test::Simple::Catch; my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); -close STDERR; + +require Dev::Null; +tie *STDERR, 'Dev::Null'; ok(1); ok(1); @@ -13,4 +15,4 @@ ok(1); ok(1); ok(1); -die "Almost there..."; +die "This is a test"; |