aboutsummaryrefslogtreecommitdiff
path: root/forth/misc-tests.fs
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2015-02-12 19:27:00 -0500
committerChouser <chouser@n01se.net>2015-02-21 13:22:44 -0500
commit9da223a35a176d94fbb75cbcc1000871ff5aff0b (patch)
treeab7d1e75f8b567c0dd0a84c507e8415dd83ada0b /forth/misc-tests.fs
parent2e78e94eb894e511e583db03286a3c13b9ecc780 (diff)
downloadmal-9da223a35a176d94fbb75cbcc1000871ff5aff0b.tar.gz
mal-9da223a35a176d94fbb75cbcc1000871ff5aff0b.zip
forth: Add step 2
Diffstat (limited to 'forth/misc-tests.fs')
-rw-r--r--forth/misc-tests.fs28
1 files changed, 28 insertions, 0 deletions
diff --git a/forth/misc-tests.fs b/forth/misc-tests.fs
index 5aaf2f2..c428a12 100644
--- a/forth/misc-tests.fs
+++ b/forth/misc-tests.fs
@@ -51,3 +51,31 @@ mal-nil
20 MalInt. swap conj
23 MalInt. mal-nil conj conj conj
pr-str s" (nil (20 (42) 10) 23)" str= -1 test=
+
+\ map tests
+
+s" one" MalString. s" one" MalString. mal= -1 test=
+s" one" MalString. s" x" MalString. mal= 0 test=
+
+MalMap/Empty
+s" one" MalString. s" first" MalString. rot assoc
+s" two" MalString. s" second" MalString. rot assoc
+s" three" MalString. s" third" MalString. rot assoc
+
+dup 99 s" two" MalString. rot get s" second" MalString. mal= -1 test=
+dup 99 s" none" MalString. rot get 99 test=
+drop
+
+\ eval tests
+
+require step2_eval.fs
+
+mal-nil
+ 1 MalInt. swap conj
+ 2 MalInt. swap conj
+ 3 MalInt. swap conj
+~~
+mal-eval
+~~
+
+bye