@@ -9,32 +9,62 @@ errorfn() { "$@"; }
9
9
warnfn () { " $@ " ; }
10
10
infofn () { " $@ " ; }
11
11
12
+ @test " core.print_error_fn works" {
13
+ run errorfn core.print_error_fn
14
+ assert_success
15
+ assert_output ' Error: errorfn'
16
+
17
+ run errorfn core.print_error_fn ' Something'
18
+ assert_success
19
+ assert_output ' Error: errorfn: Something'
20
+ }
21
+
22
+ @test " core.print_warn_fn works" {
23
+ run warnfn core.print_warn_fn
24
+ assert_success
25
+ assert_output ' Warn: warnfn'
26
+
27
+ run warnfn core.print_warn_fn ' Something'
28
+ assert_success
29
+ assert_output ' Warn: warnfn: Something'
30
+ }
31
+
32
+ @test " core.print_info_fn works" {
33
+ run infofn core.print_info_fn
34
+ assert_success
35
+ assert_output ' Info: infofn'
36
+
37
+ run infofn core.print_info_fn ' Something'
38
+ assert_success
39
+ assert_output ' Info: infofn: Something'
40
+ }
41
+
12
42
@test " core.print_error works" {
13
43
run errorfn core.print_error
14
44
assert_success
15
- assert_output ' Error: errorfn '
45
+ assert_output ' Error'
16
46
17
47
run errorfn core.print_error ' Something'
18
48
assert_success
19
- assert_output ' Error: errorfn: Something'
49
+ assert_output ' Error: Something'
20
50
}
21
51
22
52
@test " core.print_warn works" {
23
53
run warnfn core.print_warn
24
54
assert_success
25
- assert_output ' Warn: warnfn '
55
+ assert_output ' Warn'
26
56
27
57
run warnfn core.print_warn ' Something'
28
58
assert_success
29
- assert_output ' Warn: warnfn: Something'
59
+ assert_output ' Warn: Something'
30
60
}
31
61
32
62
@test " core.print_info works" {
33
63
run infofn core.print_info
34
64
assert_success
35
- assert_output ' Info: infofn '
65
+ assert_output ' Info'
36
66
37
67
run infofn core.print_info ' Something'
38
68
assert_success
39
- assert_output ' Info: infofn: Something'
69
+ assert_output ' Info: Something'
40
70
}
0 commit comments