This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Test-Simple-0.63
[perl5.git] / lib / Test / Simple / t / tbt_01basic.t
1 #!/usr/bin/perl
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = '../lib';
7     }
8 }
9
10 use Test::Builder::Tester tests => 12;
11 use Test::More;
12
13 ok(1,"This is a basic test");
14
15 test_out("ok 1 - tested");
16 ok(1,"tested");
17 test_test("captured okay on basic");
18
19 test_out("ok 1 - tested");
20 ok(1,"tested");
21 test_test("captured okay again without changing number");
22
23 ok(1,"test unrelated to Test::Builder::Tester");
24
25 test_out("ok 1 - one");
26 test_out("ok 2 - two");
27 ok(1,"one");
28 ok(2,"two");
29 test_test("multiple tests");
30
31 test_out("not ok 1 - should fail");
32 test_err("#     Failed test ($0 at line 35)");
33 test_err("#          got: 'foo'");
34 test_err("#     expected: 'bar'");
35 is("foo","bar","should fail");
36 test_test("testing failing");
37
38
39 test_out("not ok 1");
40 test_out("not ok 2");
41 test_fail(+2);
42 test_fail(+1);
43 fail();  fail();
44 test_test("testing failing on the same line with no name");
45
46
47 test_out("not ok 1 - name");
48 test_out("not ok 2 - name");
49 test_fail(+2);
50 test_fail(+1);
51 fail("name");  fail("name");
52 test_test("testing failing on the same line with the same name");
53
54
55 test_out("not ok 1 - name # TODO Something");
56 test_err("#     Failed (TODO) test ($0 at line 59)");
57 TODO: { 
58     local $TODO = "Something";
59     fail("name");
60 }
61 test_test("testing failing with todo");
62