@@ -3,7 +3,7 @@ Feature: Functions
3
3
Given a file named "main.cloe" with:
4
4
"""
5
5
(def (f x) x)
6
- (write (f 42))
6
+ (print (f 42))
7
7
"""
8
8
When I successfully run `cloe main.cloe`
9
9
Then the stdout should contain exactly "42"
@@ -12,7 +12,7 @@ Feature: Functions
12
12
Given a file named "main.cloe" with:
13
13
"""
14
14
(def (f x) x)
15
- (write (f 123))
15
+ (print (f 123))
16
16
"""
17
17
When I successfully run `cloe main.cloe`
18
18
Then the stdout should contain exactly "123"
@@ -21,7 +21,7 @@ Feature: Functions
21
21
Given a file named "main.cloe" with:
22
22
"""
23
23
(def (f x y) (+ x y))
24
- (write (f 123 456))
24
+ (print (f 123 456))
25
25
"""
26
26
When I successfully run `cloe main.cloe`
27
27
Then the stdout should contain exactly "579"
@@ -32,9 +32,9 @@ Feature: Functions
32
32
(def (func . x nil) x)
33
33
34
34
(seq!
35
- (write (func . x nil ..{"x" 42}))
36
- (write (func . ..{"x" nil} x 42))
37
- (write (func . ..{"x" 42} ..{"x" nil} x 42)))
35
+ (print (func . x nil ..{"x" 42}))
36
+ (print (func . ..{"x" nil} x 42))
37
+ (print (func . ..{"x" 42} ..{"x" nil} x 42)))
38
38
"""
39
39
When I successfully run `cloe main.cloe`
40
40
Then the stdout should contain exactly:
@@ -48,7 +48,7 @@ Feature: Functions
48
48
Given a file named "main.cloe" with:
49
49
"""
50
50
(def (f x ..args . foo 4 ..kwargs) (+ x ..args foo))
51
- (write (f 1 2 . foo 3))
51
+ (print (f 1 2 . foo 3))
52
52
"""
53
53
When I successfully run `cloe main.cloe`
54
54
Then the stdout should contain exactly "6"
@@ -59,7 +59,7 @@ Feature: Functions
59
59
(def (func x1 x2 ..args . y1 0 y2 1 ..kwargs)
60
60
(+ x1 x2 ..args y1 y2))
61
61
62
- (write (func 1 1 1 ..[1 1 1] . y1 1 1 100000000 ..{"y2" 1}))
62
+ (print (func 1 1 1 ..[1 1 1] . y1 1 1 100000000 ..{"y2" 1}))
63
63
"""
64
64
When I successfully run `cloe main.cloe`
65
65
Then the stdout should contain exactly "8"
@@ -68,7 +68,7 @@ Feature: Functions
68
68
Given a file named "main.cloe" with:
69
69
"""
70
70
(let foo 123)
71
- (write foo)
71
+ (print foo)
72
72
"""
73
73
When I successfully run `cloe main.cloe`
74
74
Then the stdout should contain exactly "123"
@@ -78,9 +78,9 @@ Feature: Functions
78
78
"""
79
79
(let l [42 ..l])
80
80
81
- (write (l 1))
82
- (write (l 2))
83
- (write (l 3))
81
+ (print (l 1))
82
+ (print (l 2))
83
+ (print (l 3))
84
84
"""
85
85
When I run `cloe main.cloe`
86
86
Then the exit status should not be 0
@@ -92,7 +92,7 @@ Feature: Functions
92
92
(let bar (+ x x))
93
93
bar)
94
94
95
- (write (foo 21))
95
+ (print (foo 21))
96
96
"""
97
97
When I successfully run `cloe main.cloe`
98
98
Then the stdout should contain exactly "42"
@@ -105,7 +105,7 @@ Feature: Functions
105
105
(let baz (- x y))
106
106
(* bar baz (+ x y)))
107
107
108
- (write (foo 2 3))
108
+ (print (foo 2 3))
109
109
"""
110
110
When I successfully run `cloe main.cloe`
111
111
Then the stdout should contain exactly "-20"
@@ -117,7 +117,7 @@ Feature: Functions
117
117
(def (g y) (+ x y))
118
118
(g 42))
119
119
120
- (write (f 2007))
120
+ (print (f 2007))
121
121
"""
122
122
When I successfully run `cloe main.cloe`
123
123
Then the stdout should contain exactly "2049"
@@ -132,7 +132,7 @@ Feature: Functions
132
132
h)
133
133
((g 456) 789))
134
134
135
- (write (f 123))
135
+ (print (f 123))
136
136
"""
137
137
When I successfully run `cloe main.cloe`
138
138
Then the stdout should contain exactly "1368"
@@ -145,7 +145,7 @@ Feature: Functions
145
145
(let x (+ x 1))
146
146
x)
147
147
148
- (write (f 1))
148
+ (print (f 1))
149
149
"""
150
150
When I successfully run `cloe main.cloe`
151
151
Then the stdout should contain exactly "3"
@@ -157,15 +157,15 @@ Feature: Functions
157
157
(def (g x) x)
158
158
(g 42))
159
159
160
- (write (f 123456))
160
+ (print (f 123456))
161
161
"""
162
162
When I successfully run `cloe main.cloe`
163
163
Then the stdout should contain exactly "42"
164
164
165
165
Scenario : Call an anonymous function
166
166
Given a file named "main.cloe" with:
167
167
"""
168
- (write ((\ (x) x) "Hello, world!"))
168
+ (print ((\ (x) x) "Hello, world!"))
169
169
"""
170
170
When I successfully run `cloe main.cloe`
171
171
Then the stdout should contain exactly "Hello, world!"
0 commit comments