Merge pull request #413 from bjh21/bjh21-nontrivial-hashmap
authorJoel Martin <github@martintribe.org>
Mon, 8 Jul 2019 15:08:50 +0000 (10:08 -0500)
committerGitHub <noreply@github.com>
Mon, 8 Jul 2019 15:08:50 +0000 (10:08 -0500)
step 1: Test a hash-map with more than one entry.

1  2 
tests/step1_read_print.mal

@@@ -157,10 -153,12 +157,14 @@@ fals
  ;=>{"a" {"b" {"c" 3}}}
  {  "a"  {"b"   {  "cde"     3   }  }}
  ;=>{"a" {"b" {"cde" 3}}}
+ ;;; The regexp sorcery here ensures that each key goes with the correct
+ ;;; value and that each key appears only once.
+ {"a1" 1 "a2" 2 "a3" 3}
+ ;/{"a([1-3])" \1 "a(?!\1)([1-3])" \2 "a(?!\1)(?!\2)([1-3])" \3}
  {  :a  {:b   {  :cde     3   }  }}
  ;=>{:a {:b {:cde 3}}}
 +({})
 +;=>({})
  
  ;; Testing read of comments
   ;; whole line comment (not an exception)