dds/utils-tests.rkt
Sergiu Ivanov c33641fd66 utils: Start and auto-hash-ref/explicit.
Also add the tests for utils.
2020-02-16 21:39:42 +01:00

16 lines
496 B
Racket

#lang typed/racket
;;; Tests for dds/utils.
(require typed/rackunit "utils.rkt")
(test-begin
(test-case "auto-hash-ref/explicit"
(let ([mytable #hash((a . 3) (b . 4))])
(check-equal? (auto-hash-ref/explicit (mytable b a)
(* a b))
12))
(let ([ht #hash((a . #t) (b . #f))])
(check-equal? (auto-hash-ref/explicit (ht a b)
(and (not a) b))
#f))))