This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move Test::Simple from ext/ to cpan/
[perl5.git] / cpan / Test-Simple / t / Builder / Builder.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = '../lib';
7     }
8 }
9
10 use Test::Builder;
11 my $Test = Test::Builder->new;
12
13 $Test->plan( tests => 7 );
14
15 my $default_lvl = $Test->level;
16 $Test->level(0);
17
18 $Test->ok( 1,  'compiled and new()' );
19 $Test->ok( $default_lvl == 1,      'level()' );
20
21 $Test->is_eq('foo', 'foo',      'is_eq');
22 $Test->is_num('23.0', '23',     'is_num');
23
24 $Test->is_num( $Test->current_test, 4,  'current_test() get' );
25
26 my $test_num = $Test->current_test + 1;
27 $Test->current_test( $test_num );
28 print "ok $test_num - current_test() set\n";
29
30 $Test->ok( 1, 'counter still good' );