| 1 |
(library (tests hashtables) |
| 2 |
(export run-tests) |
| 3 |
(import |
| 4 |
(ikarus) |
| 5 |
(rnrs hashtables) |
| 6 |
(tests framework)) |
| 7 |
|
| 8 |
(define (run-tests) (test-hashtables)) |
| 9 |
|
| 10 |
(define-tests test-hashtables |
| 11 |
[values |
| 12 |
(let ([h (make-eq-hashtable)]) |
| 13 |
(hashtable-set! h 'foo 12) |
| 14 |
(hashtable-set! h 'bar 13) |
| 15 |
(or (equal? (hashtable-keys h) '#(foo bar)) |
| 16 |
(equal? (hashtable-keys h) '#(bar foo))))] |
| 17 |
[values |
| 18 |
(let ([h (make-eq-hashtable)]) |
| 19 |
(hashtable-set! h 'foo 12) |
| 20 |
(hashtable-set! h 'bar 13) |
| 21 |
(hashtable-clear! h) |
| 22 |
(equal? (hashtable-keys h) '#()))] |
| 23 |
)) |
| 24 |
|