1
1
mirror of https://github.com/kanaka/mal.git synced 2024-08-16 09:10:48 +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:
Ben Harris 2019-07-07 18:36:07 +01:00
parent 9ee2a05605
commit 80512fcc84
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -233,6 +233,9 @@
(keys hm2)
;=>("a")
(keys {"1" 1})
;=>("1")
;;; TODO: fix. Clojure returns nil but this breaks mal impl
(vals hm1)
;=>()