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 58
58
($ all_args (__replace_placeholders [arg_bloc] ...args))
59
59
(fun (arg_bloc) (call all_args)) })
60
60
61
- ($ unless (cond body)
62
- (if (not cond) body))
61
+ ($ unless (cond ... body)
62
+ (if (not cond) ... body))
63
63
64
64
($ until (cond body)
65
65
(while (not cond) body))
Original file line number Diff line number Diff line change 16
16
(let test_func3 (partial2 test_func 1 _ 3))
17
17
18
18
(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