www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

test-adt-structure-wrapped.rkt (537B)


      1 #lang typed/racket
      2 
      3 (require phc-adt
      4          phc-toolkit
      5          type-expander
      6          typed/rackunit
      7          (only-in (lib "phc-adt/tagged-structure-low-level.hl.rkt")
      8                   λ-tagged-get-field))
      9 (adt-init)
     10 
     11 (define i (structure [a 1 : Number] [b "b" : String]))
     12 (define c (structure [a : Number] [b : String]))
     13 (define i2 (c 1 "b"))
     14 
     15 (check-equal?: (uniform-get i a) : Number 1)
     16 (check-equal?: (uniform-get i b) : String "b")
     17 (check-equal?: (uniform-get i2 a) : Number 1)
     18 (check-equal?: (uniform-get i2 b) : String "b")