]> git.vpit.fr Git - perl/modules/Test-Leaner.git/blob - t/05-pass.t
Fall back to Test::More when PERL_TEST_LEANER_USES_TEST_MORE is set
[perl/modules/Test-Leaner.git] / t / 05-pass.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 BEGIN { delete $ENV{PERL_TEST_LEANER_USES_TEST_MORE} }
9
10 use Test::Leaner ();
11
12 use lib 't/lib';
13 use Test::Leaner::TestHelper;
14
15 my $buf = '';
16 capture_to_buffer $buf or plan skip_all => 'perl 5.8 required to test pass()';
17
18 plan tests => 4;
19
20 reset_buffer {
21  local $@;
22  eval { Test::Leaner::pass() };
23  is $@,   '',       'pass() does not croak';
24  is $buf, "ok 1\n", 'pass() produces the correct TAP code';
25 };
26
27 reset_buffer {
28  local $@;
29  eval { Test::Leaner::pass('this is a comment') };
30  is $@,   '', 'pass("comment") does not croak';
31  is $buf, "ok 2 - this is a comment\n",
32               'pass("comment") produces the correct TAP code';
33 };