diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-01 22:50:55 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-01 22:50:55 -0500 |
| commit | 9528bb145193159fa3e697da642e32a0877af5fb (patch) | |
| tree | 3375b4524d7c845ec33c7636fb7697ce3c1d6a42 /tests/stepA_more.mal | |
| parent | 950e3c765e30648de34cfc4f65fffdce06f0727f (diff) | |
| download | mal-9528bb145193159fa3e697da642e32a0877af5fb.tar.gz mal-9528bb145193159fa3e697da642e32a0877af5fb.zip | |
All: pass stepA tests, in particular with correct conj behavior.
Diffstat (limited to 'tests/stepA_more.mal')
| -rw-r--r-- | tests/stepA_more.mal | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/stepA_more.mal b/tests/stepA_more.mal index bae226d..31eb2bb 100644 --- a/tests/stepA_more.mal +++ b/tests/stepA_more.mal @@ -103,15 +103,24 @@ (conj (list) 1) ;=>(1) (conj (list 1) 2) -;=>(1 2) +;=>(2 1) (conj (list 2 3) 4) -;=>(2 3 4) +;=>(4 2 3) (conj (list 2 3) 4 5 6) -;=>(2 3 4 5 6) +;=>(6 5 4 2 3) (conj (list 1) (list 2 3)) -;=>(1 (2 3)) -(conj [1 2] [3 4] ) -;=>(1 2 [3 4]) +;=>((2 3) 1) + +(conj [] 1) +;=>[1] +(conj [1] 2) +;=>[1 2] +(conj [2 3] 4) +;=>[2 3 4] +(conj [2 3] 4 5 6) +;=>[2 3 4 5 6] +(conj [1] [2 3]) +;=>[1 [2 3]] ;; Testing first/rest functions (first '()) @@ -190,6 +199,9 @@ (vals hm2) ;=>(1) +(count (keys (assoc hm2 "b" 2 "c" 3))) +;=>3 + (def! hm3 (assoc hm2 "b" 2)) (count (keys hm3)) ;=>2 @@ -263,8 +275,8 @@ ;; ;; Testing read-str and eval -(read-string "[1 2 (3 4) nil]") -;=>[1 2 (3 4) nil] +(read-string "(1 2 (3 4) nil)") +;=>(1 2 (3 4) nil) (eval (read-string "(+ 4 5)")) ;=>9 |
