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 11# internal, do not use
22(let _make_suite (fun (name) {
3+ (mut active false)
34 (mut passed 0)
45 (mut failed 0)
56 (mut failures [])
3334 (let need_case? (fun ()
3435 (and (not (empty? case_desc)) (!= case_pointer (len cases)))))
3536
37+ (let set_active (fun (bool)
38+ (set active bool)))
39+
3640 (fun (
3741 &name
3842 &passed
4953 &add_case
5054 &pop_case
5155 &update_case_ptr
52- &need_case?)
56+ &need_case?
57+ &active
58+ &set_active)
5359 ()) }))
5460
5561# internal, do not use
5662(mut _suite nil)
5763
5864# internal, do not use
5965(let _runner (fun (_name _callable) {
66+ (_suite.set_active true)
6067 (let _start_time (time))
6168
6269 # run test
6370 (_callable)
6471 (let _end_time (time))
72+ (_suite.set_active false)
6573
6674 # no newline, yet
6775 (puts _name)
238246# =end
239247# @author https://github.com/SuperFola
240248(macro test:suite (_name _body) {
249+ (assert (or (nil? testing:_suite) (not testing:_suite.active)) "Can not nest multiple test suites together!")
241250 (set testing:_suite (testing:_make_suite ($repr _name)))
242251
243252 (let ($symcat _name "-output") (testing:_runner
You can’t perform that action at this time.
0 commit comments