accept regular hash for `hash->attrs`

dev-fixit
Matthew Butterick 8 years ago
parent 65e96c8232
commit 5cb2d6d93e

@ -229,7 +229,7 @@
(define+provide+safe (hash->attrs attr-hash)
(hash-eq? . -> . txexpr-attrs?)
(hash? . -> . txexpr-attrs?)
(map (λ(k) (list k (hash-ref attr-hash k))) (hash-keys attr-hash)))

@ -124,7 +124,7 @@
(check-equal? (attrs->hash '((foo "bar")) '(foo "fraw")) '#hasheq((foo . "fraw")))
(check-equal? (attrs->hash '((foo "bar")) '(foo "fraw") 'foo "dog") '#hasheq((foo . "dog")))
(check-equal? (apply set (hash->attrs '#hasheq((foo . "bar")(hee . "haw"))))
(check-equal? (apply set (hash->attrs '#hash((foo . "bar")(hee . "haw"))))
(apply set '((foo "bar")(hee "haw"))))
(check-equal? (attr-ref '(p ((foo "bar"))) 'foo) "bar")

Loading…
Cancel
Save