8 plan skip_all => 'perl 5.8 required to test fail()' unless $] >= 5.008;
11 open my $memory_stream, '>', \$buf
12 or plan skip_all => 'could not create the in-memory file';
20 eval { Test::Leaner::tap_stream($memory_stream) };
21 is $@, '', 'tap_stream($fh) does not croak';
27 seek $memory_stream, 0, 0;
28 eval { Test::Leaner::fail() };
29 is $@, '', 'fail() does not croak';
30 is $buf, "not ok 1\n", 'fail() produces the correct TAP code';
36 seek $memory_stream, 0, 0;
37 eval { Test::Leaner::fail('this is a comment') };
38 is $@, '', 'fail("comment") does not croak';
39 is $buf, "not ok 2 - this is a comment\n",
40 'fail("comment") produces the correct TAP code';