File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
# internal, do not use
2
2
(let _make_suite (fun (name) {
3
+ (mut active false)
3
4
(mut passed 0)
4
5
(mut failed 0)
5
6
(mut failures [])
33
34
(let need_case? (fun ()
34
35
(and (not (empty? case_desc)) (!= case_pointer (len cases)))))
35
36
37
+ (let set_active (fun (bool)
38
+ (set active bool)))
39
+
36
40
(fun (
37
41
&name
38
42
&passed
49
53
&add_case
50
54
&pop_case
51
55
&update_case_ptr
52
- &need_case?)
56
+ &need_case?
57
+ &active
58
+ &set_active)
53
59
()) }))
54
60
55
61
# internal, do not use
56
62
(mut _suite nil)
57
63
58
64
# internal, do not use
59
65
(let _runner (fun (_name _callable) {
66
+ (_suite.set_active true)
60
67
(let _start_time (time))
61
68
62
69
# run test
63
70
(_callable)
64
71
(let _end_time (time))
72
+ (_suite.set_active false)
65
73
66
74
# no newline, yet
67
75
(puts _name)
238
246
# =end
239
247
# @author https://github.com/SuperFola
240
248
(macro test:suite (_name _body) {
249
+ (assert (or (nil? testing:_suite) (not testing:_suite.active)) "Can not nest multiple test suites together!")
241
250
(set testing:_suite (testing:_make_suite ($repr _name)))
242
251
243
252
(let ($symcat _name "-output") (testing:_runner
You can’t perform that action at this time.
0 commit comments