Tweaks to get Test::Builder::Tester's tests to work in the core.
[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
845d7e37 10use Test::Builder::Tester tests => 9;
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");
d1ca9ea3 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
39test_out("not ok 1");
40test_out("not ok 2");
41test_fail(+2);
42test_fail(+1);
43fail(); fail();
44test_test("testing failing on the same line with no name");
45
46
47test_out("not ok 1 - name");
48test_out("not ok 2 - name");
49test_fail(+2);
50test_fail(+1);
51fail("name"); fail("name");
52test_test("testing failing on the same line with the same name");
53
54
55test_out("not ok 1 - name # TODO Something");
d1ca9ea3 56test_err("# Failed (TODO) test ($0 at line 59)");
845d7e37 57TODO: {
58 local $TODO = "Something";
59 fail("name");
60}
61test_test("testing failing with todo");
62