2 # Copyright (C) 2005-2008, Parrot Foundation.
6 load_bytecode 'Test/Builder/Tester.pbc'
12 test = new [ 'Test'; 'Builder' ], tb_args
20 plan = get_global [ 'Test'; 'Builder'; 'Tester' ], 'plan'
21 test_pass = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_pass'
22 test_fail = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_fail'
23 test_out = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_out'
24 test_diag = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_diag'
25 test_test = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_test'
29 test_out( 'ok 1 - hi' )
31 test_test( 'passing test')
33 test_out( 'not ok 2 - bye' )
35 test_test( 'failing test')
37 test_out( 'ok 3 - A message' )
38 test_diag( "some\nlines" )
39 test.'ok'( 1, 'A message' )
41 test.'diag'( 'lines' )
42 test_test( 'passing test with diagnostics' )
44 test_out( 'not ok 4 - another message' )
45 test.'ok'( 0, 'another message' )
46 test.'diag'( "many\nmany\nlines" )
50 test_test( 'failing test with diagnostics' )
52 test_out( 'ok 5 #skip just one skip' )
53 test.'skip'( 1, 'just one skip' )
54 test_test( 'single skip' )
56 test_out( 'ok 6 #skip three skips' )
57 test_out( 'ok 7 #skip three skips' )
58 test_out( 'ok 8 #skip three skips' )
59 test.'skip'( 3, 'three skips' )
60 test_test( 'multiple skips' )
62 test_out( "not ok 9 # TODO \n\tFailed (TODO) test 'some todo test'" )
63 test.'todo'( 0, 'some todo test' )
64 test_test( 'failing todo test' )
66 test_out( "ok 10 # TODO another todo test" )
67 test.'todo'( 1, 'reason', 'another todo test' )
68 test_test( 'passing todo test' )
72 test_test( 'passing test with no description' )
74 test_pass( 'my description' )
75 test.'ok'( 1, 'my description' )
76 test_test( 'passing test with a description' )
80 test_test( 'failing test with no description' )
82 test_fail( 'failing description' )
83 test.'ok'( 0, 'failing description' )
84 test_test( 'failing test with description' )
93 # vim: expandtab shiftwidth=4 ft=pir: