home: hub: zuo

ref: dcf77fa75d578d655ccb37d9d2b706d5eafcaa1a
dir: /tests/opaque.zuo/

View raw version
#lang zuo

(require "harness.zuo")

(alert "opaque records")

(check (not (pair? (opaque 'hello "hi"))))

(check (opaque-ref 'hello (opaque 'hello "hi") #f) "hi")
(check (opaque-ref 'not-hello (opaque 'hello "hi") #f) #f)
(check (opaque-ref (string->uninterned-symbol "hello") (opaque 'hello "hi") #f) #f)
(check (opaque-ref 'hello (opaque (string->uninterned-symbol "hello") "hi") #f) #f)
(check (opaque-ref (opaque 'hello "hi") 'hello #f) #f)
(check (opaque-ref 10 10 #f) #f)
(check (opaque-ref 10 10 'no) 'no)