3 \
=== basic testing util
=== /
8 cr
." assert failed on line " sourceline
# .
9 swap cr
." | got " . cr
." | expected " . cr
12 \ array
function tests
13 create
za 2 , 6 , 7 , 10 , 15 , 80 , 81 ,
15 7 za 2 array
-find
-1 test
= 0 test
=
16 7 za 6 array
-find
-1 test
= 1 test
=
17 7 za 10 array
-find
-1 test
= 3 test
=
18 7 za 81 array
-find
-1 test
= 6 test
=
19 7 za 12 array
-find
0 test
= 4 test
=
20 7 za 8 array
-find
0 test
= 3 test
=
21 7 za 100 array
-find
0 test
= 7 test
=
22 7 za 1 array
-find
0 test
= 0 test
=
23 6 za 81 array
-find
0 test
= 6 test
=
26 1 swap
0 5 array
-insert
27 2 swap
1 7 array
-insert
28 3 swap
3 12 array
-insert
29 4 swap
4 15 array
-insert
30 5 swap
5 20 array
-insert
32 dup
0 cells
+ @ 5 test
=
33 dup
1 cells
+ @ 7 test
=
34 dup
2 cells
+ @ 10 test
=
35 dup
3 cells
+ @ 12 test
=
36 dup
4 cells
+ @ 15 test
=
37 dup
5 cells
+ @ 20 test
=
44 42 MalInt. mal
-nil
conj
45 10 MalInt. mal
-nil
conj conj
47 23 MalInt. mal
-nil
conj conj conj
48 pr
-str s
" (nil (20 (42) 10) 23)" str
= -1 test
=
50 1500 MalInt. 1500 MalInt. test
=
54 here
1 MalInt. , 2 MalInt. , 3 MalInt. , here
>MalList
57 pr
-str s
" (5 4 1 2 3)" str
= -1 test
=
61 s
" one" MalString. s
" one" MalString. test
=
62 s
" one" MalString. s
" x" MalString. m
= 0 test
=
65 1000 MalInt. 1100 rot
assoc
66 2000 MalInt. 2100 rot
assoc
67 3000 MalInt. 3100 rot
assoc
69 dup
99 2000 MalInt. rot
get 2100 test
=
70 dup
99 4000 MalInt. rot
get 99 test
=
74 s
" one" MalString. s
" first" MalString. rot
assoc
75 s
" two" MalString. s
" second" MalString. rot
assoc
76 s
" three" MalString. s
" third" MalString. rot
assoc
78 dup
99 s
" two" MalString. rot
get s
" second" MalString. test
=
79 dup
99 s
" none" MalString. rot
get 99 test
=
82 99 MalInt. 10 MalInt. MalMap/Empty get 99 MalInt. test
=