Re: [PATCH] various safety/portability tweaks
[p5sagit/p5-mst-13.2.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_fail(+2);
40 test_fail(+1);
41 fail();  fail();
42 test_test("testing failing on the same line with no name");
43
44
45 test_fail(+2, 'name');
46 test_fail(+1, 'name_two');
47 fail("name");  fail("name_two");
48 test_test("testing failing on the same line with the same name");
49
50
51 test_out("not ok 1 - name # TODO Something");
52 my $line = __LINE__ + 4;
53 test_err("#     Failed (TODO) test ($0 at line $line)");
54 TODO: { 
55     local $TODO = "Something";
56     fail("name");
57 }
58 test_test("testing failing with todo");
59
60 test_pass();
61 pass();
62 test_test("testing passing with test_pass()");
63
64 test_pass("some description");
65 pass("some description");
66 test_test("testing passing with test_pass() and description");
67
68 test_pass("one test");
69 test_pass("... and another");
70 ok(1, "one test");
71 ok(1, "... and another");
72 test_test("testing pass_test() and multiple tests");