Clear up test based on line number differences between the core and the
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / tbt_01basic.t
CommitLineData
845d7e37 1#!/usr/bin/perl
2
c0888b21 3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 chdir 't';
6 @INC = '../lib';
7 }
8}
9
68938d83 10use Test::Builder::Tester tests => 12;
845d7e37 11use Test::More;
12
13ok(1,"This is a basic test");
14
15test_out("ok 1 - tested");
16ok(1,"tested");
17test_test("captured okay on basic");
18
19test_out("ok 1 - tested");
20ok(1,"tested");
21test_test("captured okay again without changing number");
22
23ok(1,"test unrelated to Test::Builder::Tester");
24
25test_out("ok 1 - one");
26test_out("ok 2 - two");
27ok(1,"one");
28ok(2,"two");
29test_test("multiple tests");
30
31test_out("not ok 1 - should fail");
0295a53a 32test_err("# Failed test ($0 at line 35)");
845d7e37 33test_err("# got: 'foo'");
34test_err("# expected: 'bar'");
35is("foo","bar","should fail");
36test_test("testing failing");
37
38
845d7e37 39test_fail(+2);
40test_fail(+1);
41fail(); fail();
42test_test("testing failing on the same line with no name");
43
44
dd2bedf4 45test_fail(+2, 'name');
46test_fail(+1, 'name_two');
47fail("name"); fail("name_two");
845d7e37 48test_test("testing failing on the same line with the same name");
49
50
51test_out("not ok 1 - name # TODO Something");
dd2bedf4 52my $line = __LINE__ + 4;
53test_err("# Failed (TODO) test ($0 at line $line)");
845d7e37 54TODO: {
55 local $TODO = "Something";
56 fail("name");
57}
58test_test("testing failing with todo");
59
dd2bedf4 60test_pass();
61pass();
62test_test("testing passing with test_pass()");
63
64test_pass("some description");
65pass("some description");
66test_test("testing passing with test_pass() and description");
67
68test_pass("one test");
69test_pass("... and another");
70ok(1, "one test");
71ok(1, "... and another");
72test_test("testing pass_test() and multiple tests");