2007-10-10 08:24:12 -04:00
|
|
|
(library (tests hashtables)
|
|
|
|
(export test-hashtables)
|
|
|
|
(import
|
|
|
|
(ikarus)
|
|
|
|
(rnrs hashtables)
|
|
|
|
(tests framework))
|
|
|
|
|
|
|
|
(define-tests test-hashtables
|
|
|
|
[values
|
|
|
|
(let ([h (make-eq-hashtable)])
|
|
|
|
(hashtable-set! h 'foo 12)
|
|
|
|
(hashtable-set! h 'bar 13)
|
|
|
|
(or (equal? (hashtable-keys h) '#(foo bar))
|
2007-10-10 09:18:11 -04:00
|
|
|
(equal? (hashtable-keys h) '#(bar foo))))]
|
|
|
|
[values
|
|
|
|
(let ([h (make-eq-hashtable)])
|
|
|
|
(hashtable-set! h 'foo 12)
|
|
|
|
(hashtable-set! h 'bar 13)
|
|
|
|
(hashtable-clear! h)
|
|
|
|
(equal? (hashtable-keys h) '#()))]
|
|
|
|
))
|
2007-10-10 08:24:12 -04:00
|
|
|
|