-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoun-test.fs
208 lines (190 loc) · 3.79 KB
/
noun-test.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
\ Test suite for nock
include nock.fs
\ Creates [[4 5] [6 14 15]]
: make-subject
4 make-atom
5 make-atom
make-cell
6 make-atom
14 make-atom
15 make-atom
make-cell
make-cell
make-cell ;
: show-test
.noun ." -> "
nock
.noun ;
: test-auto \ [50 [[0 1] [1 203]]]
50 make-atom
0 make-atom
1 make-atom
make-cell
1 make-atom
203 make-atom
make-cell
make-cell
make-cell
show-test ;
: test-slot
make-subject
0 make-atom
1 make-atom
make-cell make-cell
show-test ;
: test-constant
make-subject
1 make-atom
0 make-atom
make-cell make-cell
show-test ;
: test-eval
50 make-atom
51 make-atom
make-cell
2 make-atom
0 make-atom
3 make-atom
make-cell
1 make-atom
4 make-atom
0 make-atom
1 make-atom
make-cell make-cell make-cell
make-cell make-cell make-cell
show-test ;
: test-cell
make-subject
3 make-atom
0 make-atom
4 make-atom
make-cell make-cell make-cell
show-test ;
: test-inc
make-subject
4 make-atom
0 make-atom
15 make-atom
make-cell make-cell make-cell
show-test ;
: test-eq
make-subject
5 make-atom
4 make-atom
0 make-atom
15 make-atom
make-cell make-cell
0 make-atom
3 make-atom
make-cell make-cell make-cell
make-cell
show-test ;
: test-if \ [1 [6 [0 1] [0 1] [4 0 1]]]
1 make-atom
6 make-atom
0 make-atom
1 make-atom
make-cell
0 make-atom
1 make-atom
make-cell
4 make-atom
0 make-atom
1 make-atom
make-cell make-cell make-cell
make-cell make-cell make-cell
show-test ;
: test-comp \ [42 [7 [4 0 1] [4 0 1]]]
42 make-atom
7 make-atom
4 make-atom
0 make-atom
1 make-atom
make-cell
make-cell
4 make-atom
0 make-atom
1 make-atom
make-cell make-cell make-cell make-cell make-cell
show-test ;
: test-varadd \ [[67 39] [8 [0 3] [4 0 2]]]
67 make-atom
39 make-atom make-cell
8 make-atom
0 make-atom
3 make-atom
make-cell
4 make-atom
0 make-atom
2 make-atom
make-cell make-cell make-cell make-cell make-cell
show-test ;
: test-core \ [45 [9 2 [1 4 0 3] 0 1]]
45 make-atom
9 make-atom
2 make-atom
1 make-atom
4 make-atom
0 make-atom
3 make-atom
make-cell make-cell make-cell
0 make-atom
1 make-atom make-cell
make-cell make-cell make-cell make-cell
show-test ;
: test-replace \ [50 [10 [2 [0 1]] [1 8 9 10]]]
50 make-atom
10 make-atom
2 make-atom
0 make-atom
1 make-atom
make-cell
make-cell
1 make-atom
8 make-atom
9 make-atom
10 make-atom
make-cell make-cell make-cell
make-cell make-cell make-cell
show-test ;
: test-dynamic-hint \ [[50 51] [11 [369 [1 20]] 0 2]]
50 make-atom
51 make-atom
make-cell
11 make-atom
369 make-atom
1 make-atom
20 make-atom
make-cell
make-cell
0 make-atom
2 make-atom
make-cell make-cell make-cell make-cell
show-test ;
: test-static-hint \ [[50 51] [11 369 0 2]]
50 make-atom
51 make-atom
make-cell
11 make-atom
369 make-atom
0 make-atom
2 make-atom
make-cell make-cell make-cell make-cell
show-test ;
: run-tests
cr
." test-auto: " test-auto cr
." test-slot: " test-slot cr
." test-constant: " test-constant cr
." test-eval: " test-eval cr
." test-cell: " test-cell cr
." test-inc: " test-inc cr
." test-eq: " test-eq cr
." test-if: " test-if cr
." test-comp: " test-comp cr
." test-varadd: " test-varadd cr
." test-core: " test-core cr
." test-replace: " test-replace cr
." test-dynamic-hint: " test-dynamic-hint cr
." test-static-hint: " test-static-hint cr
;