mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +03:00
steps 1 and 9: Test that hash-map keys stay as strings.
Specifically, test that when "1" is used as a hash-map key, it is represented as a string when printed (step 1) and when returned by 'keys' (step 9). PHP used to get both of these wrong.
This commit is contained in:
parent
9ee2a05605
commit
80512fcc84
@ -155,6 +155,8 @@ false
|
||||
;=>{"a" {"b" {"cde" 3}}}
|
||||
{ :a {:b { :cde 3 } }}
|
||||
;=>{:a {:b {:cde 3}}}
|
||||
{"1" 1}
|
||||
;=>{"1" 1}
|
||||
|
||||
;; Testing read of comments
|
||||
;; whole line comment (not an exception)
|
||||
|
@ -233,6 +233,9 @@
|
||||
(keys hm2)
|
||||
;=>("a")
|
||||
|
||||
(keys {"1" 1})
|
||||
;=>("1")
|
||||
|
||||
;;; TODO: fix. Clojure returns nil but this breaks mal impl
|
||||
(vals hm1)
|
||||
;=>()
|
||||
|
Loading…
Reference in New Issue
Block a user