tests for changes to mzlib/pconvert on immutable hash-tables

goes with https://github.com/racket/pconvert-lib/pull/2
This commit is contained in:
AlexKnauth 2015-08-21 00:04:40 -04:00 committed by Robby Findler
parent be6ae83cbd
commit f376519eed

View File

@ -217,6 +217,12 @@
(hash-set! ht 'x 1) (hash-set! ht 'x 1)
ht) ht)
'(make-hash (list (cons 'x 1)))) '(make-hash (list (cons 'x 1))))
(make-same-test (make-immutable-hasheq)
'(make-immutable-hasheq))
(make-same-test (make-immutable-hash)
'(make-immutable-hash))
(make-same-test (make-immutable-hash (list (cons 'x 1)))
'(make-immutable-hash (list (cons 'x 1))))
(make-pctest (list 'a (box (list '())) (cons 1 '())) (make-pctest (list 'a (box (list '())) (cons 1 '()))
'(list (quote a) (box (list empty)) (list 1)) '(list (quote a) (box (list empty)) (list 1))
'(list (quote a) (box (list empty)) (list 1)) '(list (quote a) (box (list empty)) (list 1))
@ -321,13 +327,13 @@
(-8- `(,-4- ,-5- (2 3)))) (-8- `(,-4- ,-5- (2 3))))
-0-)) -0-))
(make-pctest (read (open-input-string "#hasheq((#0=(1 . #0#) . a))")) (make-pctest (read (open-input-string "#hasheq((#0=(1 . #0#) . a))"))
'(shared ((-1- (cons 1 -1-))) (make-hasheq (list (cons -1- 'a)))) '(shared ((-1- (cons 1 -1-))) (make-immutable-hasheq (list (cons -1- 'a))))
'(shared ((-1- (cons 1 -1-))) (make-hasheq (list (cons -1- 'a)))) '(shared ((-1- (cons 1 -1-))) (make-immutable-hasheq (list (cons -1- 'a))))
'(shared ((-1- (cons 1 -1-))) (make-hasheq (list (cons -1- 'a)))) '(shared ((-1- (cons 1 -1-))) (make-immutable-hasheq (list (cons -1- 'a))))
'(shared ((-1- `(1 unquote -1-))) (make-hasheq (list (cons -1- 'a)))) '(shared ((-1- `(1 unquote -1-))) (make-immutable-hasheq (list (cons -1- 'a))))
'(shared ((-1- `(1 unquote -1-))) (make-hasheq (list (cons -1- 'a)))) '(shared ((-1- `(1 unquote -1-))) (make-immutable-hasheq (list (cons -1- 'a))))
'(shared ((-1- `(1 unquote -1-))) (make-hasheq (list (cons -1- 'a)))) '(shared ((-1- `(1 unquote -1-))) (make-immutable-hasheq (list (cons -1- 'a))))
'(shared ((-1- (cons 1 -1-))) (make-hasheq (list (cons -1- 'a))))))) '(shared ((-1- (cons 1 -1-))) (make-immutable-hasheq (list (cons -1- 'a)))))))
(for-each run-test tests)) (for-each run-test tests))
(let () (let ()