File tree Expand file tree Collapse file tree 2 files changed +33
-10
lines changed
Expand file tree Collapse file tree 2 files changed +33
-10
lines changed Original file line number Diff line number Diff line change 5858 ($ all_args (__replace_placeholders [arg_bloc] ...args))
5959 (fun (arg_bloc) (call all_args)) })
6060
61- ($ unless (cond body)
62- (if (not cond) body))
61+ ($ unless (cond ... body)
62+ (if (not cond) ... body))
6363
6464($ until (cond body)
6565 (while (not cond) body))
Original file line number Diff line number Diff line change 1616(let test_func3 (partial2 test_func 1 _ 3))
1717
1818(test:suite macros {
19- (test:eq (-> "f0" f1) "f0-f1")
20- (test:eq (-> "f0" f1 f2 f3) "f0-f1-f2-f3")
21- (test:eq (-> "f0" f1 (apply _ f2) (apply _ f3)) "f0-f1-f2-f3")
22-
23- (test:eq (test_func1 2 3) 6)
24- (test:eq ($argcount test_func1) 2)
25- (test:eq ($argcount test_func2) 1)
26- (test:eq (test_func3 2) 6) })
19+ (test:case "->" {
20+ (test:eq (-> "f0" f1) "f0-f1")
21+ (test:eq (-> "f0" f1 f2 f3) "f0-f1-f2-f3")
22+ (test:eq (-> "f0" f1 (apply _ f2) (apply _ f3)) "f0-f1-f2-f3") })
23+
24+ (test:case "partial & partial2" {
25+ (test:eq (test_func1 2 3) 6)
26+ (test:eq ($argcount test_func1) 2)
27+ (test:eq ($argcount test_func2) 1)
28+ (test:eq (test_func3 2) 6) })
29+
30+ (test:case "unless" {
31+ (unless false
32+ (test:expect true "unless true worked")
33+ (test:expect false "this shouldn't trigger"))
34+
35+ (unless (= "abracadabra" (f1 "f0"))
36+ (test:expect true)
37+ (test:expect false "this shouldn't trigger"))
38+
39+ (unless true
40+ (test:expect true "unless with one argument")) })
41+
42+ (test:case "until" {
43+ (mut i 0)
44+ (until (= i 10) {
45+ (set i (+ 1 i)) })
46+ (test:eq i 10)
47+
48+ (until true
49+ (test:expect false "this shouldn't trigger")) })})
You can’t perform that action at this time.
0 commit comments