Cyclic zo tests
This commit is contained in:
parent
08a48a67a0
commit
612bd22bfe
22
collects/tests/compiler/zo-exs.rkt
Normal file
22
collects/tests/compiler/zo-exs.rkt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#lang racket
|
||||||
|
(require compiler/zo-parse
|
||||||
|
compiler/zo-marshal
|
||||||
|
tests/eli-tester)
|
||||||
|
|
||||||
|
(define (roundtrip ct)
|
||||||
|
(define bs (zo-marshal ct))
|
||||||
|
(test bs
|
||||||
|
(zo-parse (open-input-bytes bs)) => ct))
|
||||||
|
|
||||||
|
(test
|
||||||
|
(local [(define (hash-test make-hash-placeholder)
|
||||||
|
(roundtrip
|
||||||
|
(compilation-top 0
|
||||||
|
(prefix 0 empty empty)
|
||||||
|
(local [(define ht-ph (make-placeholder #f))
|
||||||
|
(define ht (make-hash-placeholder (list (cons 'g ht-ph))))]
|
||||||
|
(placeholder-set! ht-ph ht)
|
||||||
|
(make-reader-graph ht)))))]
|
||||||
|
(hash-test make-hash-placeholder)
|
||||||
|
(hash-test make-hasheq-placeholder)
|
||||||
|
(hash-test make-hasheqv-placeholder)))
|
Loading…
Reference in New Issue
Block a user