1#!/usr/bin/perl
2
3use Test::Builder::Tester tests => 10;
4use Test::More;
5
6ok(1,"This is a basic test");
7
8test_out("ok 1 - tested");
9ok(1,"tested");
10test_test("captured okay on basic");
11
12test_out("ok 1 - tested");
13ok(1,"tested");
14test_test("captured okay again without changing number");
15
16ok(1,"test unrelated to Test::Builder::Tester");
17
18test_out("ok 1 - one");
19test_out("ok 2 - two");
20ok(1,"one");
21ok(2,"two");
22test_test("multiple tests");
23
24test_out(qr/ok 1 - tested\n/);
25ok(1,"tested");
26test_test("regexp matching");
27
28test_out("not ok 1 - should fail");
29test_err("#     Failed test ($0 at line 32)");
30test_err("#          got: 'foo'");
31test_err("#     expected: 'bar'");
32is("foo","bar","should fail");
33test_test("testing failing");
34
35
36test_out("not ok 1");
37test_out("not ok 2");
38test_fail(+2);
39test_fail(+1);
40fail();  fail();
41test_test("testing failing on the same line with no name");
42
43
44test_out("not ok 1 - name");
45test_out("not ok 2 - name");
46test_fail(+2);
47test_fail(+1);
48fail("name");  fail("name");
49test_test("testing failing on the same line with the same name");
50
51
52test_out("not ok 1 - name # TODO Something");
53test_out("#     Failed (TODO) test ($0 at line 56)");
54TODO: { 
55    local $TODO = "Something";
56    fail("name");
57}
58test_test("testing failing with todo");
59
60