www

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

node-low-level-quick-test.rkt (1144B)


      1 #lang typed/racket
      2 (require (lib "phc-adt/node-low-level.hl.rkt")
      3          typed/rackunit
      4          phc-toolkit
      5          phc-adt)
      6 (adt-init "./mailing-list-example/adt-pre-declarations.rkt")
      7 
      8 (define-constructor foo-ct #:tag foo :)
      9 
     10 (check-not-exn
     11  (λ ()
     12    (equal-hash-code
     13     (|(node foo values)| (delay (list 'a 'b 'c))
     14                          (raw-node (vector (list 'a 'b 'c)) 0)))))
     15 
     16 (check-not-exn
     17  (λ ()
     18    (equal-secondary-hash-code
     19     (|(node foo values)| (delay (list 'a 'b 'c))
     20                          (raw-node (vector (list 'a 'b 'c)) 0)))))
     21 
     22 (check-true: (equal?
     23               (|(node foo values)| (delay (list 'a 'b 'c))
     24                                    (raw-node (vector (list 'a 'b 'c)) 0))
     25               (|(node foo values)| (delay (list 'a 'b'c))
     26                                    (raw-node (vector (list 'a 'b 'c)) 1))))
     27 (check-false: (equal?
     28                (|(node foo values)| (delay (list 'a 'b 'c))
     29                                     (raw-node (vector (list 'a 'b 'c)) 0))
     30                (|(node foo values)| (delay (list 'a 'x 'c))
     31                                     (raw-node (vector (list 'a 'x 'c)) 1))))