improve test

v6.0-exception
Matthew Butterick 6 years ago
parent b0352ee513
commit 4e3baaab17

@ -130,8 +130,8 @@
(check-equal? (attrs->hash '((foo "bar")) '(foo "fraw") 'foo "dog") '#hasheq((foo . "bar"))) (check-equal? (attrs->hash '((foo "bar")) '(foo "fraw") 'foo "dog") '#hasheq((foo . "bar")))
(check-exn exn:fail:contract? (λ _ (attrs->hash 'foo "bar" 'zam))) (check-exn exn:fail:contract? (λ _ (attrs->hash 'foo "bar" 'zam)))
(check-equal? (apply set (hash->attrs '#hash((foo . "bar")(hee . "haw")))) (check-equal? (sort (hash->attrs '#hash((foo . "bar")(hee . "haw"))) string<? #:key cadr)
(apply set '((foo "bar")(hee "haw")))) (sort '((foo "bar")(hee "haw")) string<? #:key second))
(check-equal? (attr-ref '(p ((foo "bar"))) 'foo) "bar") (check-equal? (attr-ref '(p ((foo "bar"))) 'foo) "bar")
(check-exn exn:fail? (λ _ (attr-ref '(p ((foo "bar"))) 'zam))) (check-exn exn:fail? (λ _ (attr-ref '(p ((foo "bar"))) 'zam)))

Loading…
Cancel
Save