diff options
Diffstat (limited to 'lib/Test/t/skip.t')
-rw-r--r-- | lib/Test/t/skip.t | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/Test/t/skip.t b/lib/Test/t/skip.t new file mode 100644 index 0000000000..7db35e65dc --- /dev/null +++ b/lib/Test/t/skip.t @@ -0,0 +1,40 @@ +# -*-perl-*- +use strict; +use Test qw($TESTOUT $ntest plan ok skip); plan tests => 6; + +open F, ">skips" or die "open skips: $!"; +$TESTOUT = *F{IO}; + +skip(1, 0); #should skip + +my $skipped=1; +skip('hop', sub { $skipped = 0 }); +skip(sub {'jump'}, sub { $skipped = 0 }); +skip('skipping stones is more fun', sub { $skipped = 0 }); + +close F; + +$TESTOUT = *STDOUT{IO}; +$ntest = 1; +open F, "skips" or die "open skips: $!"; + +ok $skipped, 1, 'not skipped?'; + +my @T = <F>; +chop @T; +my @expect = split /\n+/, join('',<DATA>); +ok @T, 4; +for (my $x=0; $x < @T; $x++) { + ok $T[$x], $expect[$x]; +} + +END { close F; unlink "skips" } + +__DATA__ +ok 1 # skip + +ok 2 # skip hop + +ok 3 # skip jump + +ok 4 # skip skipping stones is more fun |