mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-13 16:07:35 +02:00
Adding test for exception values stored in hash tables.
This commit is contained in:
parent
1155893fca
commit
48209fa1c1
1 changed files with 8 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue