Adding test for exception values stored in hash tables.

This commit is contained in:
Alex Shinn 2012-12-22 16:37:18 +09:00
parent 1155893fca
commit 48209fa1c1

View file

@ -164,6 +164,14 @@
'(("cat" . black) ("dog" . white) ("elephant" . pink))
(hash-table->alist ht)))
;; Exception values - this works because the return value from the
;; primitives is a cell, and we use the cdr opcode to retrieve the
;; cell value. Thus there is no FFI issue with storing exceptions.
(let ((ht (make-hash-table)))
(hash-table-set! ht 'boom (make-exception 'my-exn-type "boom!" '() #f #f))
(test 'my-exn-type (exception-type (hash-table-ref ht 'boom))))
;; stress test
(test 625
(let ((ht (make-hash-table)))
(do ((i 0 (+ i 1))) ((= i 1000))