-
Notifications
You must be signed in to change notification settings - Fork 138
/
test_builder_tester.t
92 lines (73 loc) · 2.47 KB
/
test_builder_tester.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!./parrot
# Copyright (C) 2005-2008, Parrot Foundation.
.sub _main :main
load_bytecode 'Test/Builder/Tester.pbc'
.local pmc tb_args
tb_args = new 'Hash'
.local pmc test
test = new [ 'Test'; 'Builder' ], tb_args
.local pmc plan
.local pmc test_pass
.local pmc test_fail
.local pmc test_out
.local pmc test_diag
.local pmc test_test
plan = get_global [ 'Test'; 'Builder'; 'Tester' ], 'plan'
test_pass = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_pass'
test_fail = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_fail'
test_out = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_out'
test_diag = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_diag'
test_test = get_global [ 'Test'; 'Builder'; 'Tester' ], 'test_test'
plan( 12 )
test_out( 'ok 1 - hi' )
test.'ok'( 1, 'hi' )
test_test( 'passing test')
test_out( 'not ok 2 - bye' )
test.'ok'( 0, 'bye' )
test_test( 'failing test')
test_out( 'ok 3 - A message' )
test_diag( "some\nlines" )
test.'ok'( 1, 'A message' )
test.'diag'( 'some' )
test.'diag'( 'lines' )
test_test( 'passing test with diagnostics' )
test_out( 'not ok 4 - another message' )
test.'ok'( 0, 'another message' )
test.'diag'( "many\nmany\nlines" )
test_diag( 'many' )
test_diag( 'many' )
test_diag( 'lines' )
test_test( 'failing test with diagnostics' )
test_out( 'ok 5 #skip just one skip' )
test.'skip'( 1, 'just one skip' )
test_test( 'single skip' )
test_out( 'ok 6 #skip three skips' )
test_out( 'ok 7 #skip three skips' )
test_out( 'ok 8 #skip three skips' )
test.'skip'( 3, 'three skips' )
test_test( 'multiple skips' )
test_out( "not ok 9 # TODO \n\tFailed (TODO) test 'some todo test'" )
test.'todo'( 0, 'some todo test' )
test_test( 'failing todo test' )
test_out( "ok 10 # TODO another todo test" )
test.'todo'( 1, 'reason', 'another todo test' )
test_test( 'passing todo test' )
test_pass()
test.'ok'( 1 )
test_test( 'passing test with no description' )
test_pass( 'my description' )
test.'ok'( 1, 'my description' )
test_test( 'passing test with a description' )
test_fail()
test.'ok'( 0 )
test_test( 'failing test with no description' )
test_fail( 'failing description' )
test.'ok'( 0, 'failing description' )
test_test( 'failing test with description' )
test.'finish'()
.end
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: