www

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

test-experiment.rkt (1197B)


      1 #lang typed/racket
      2 (require typed-worklist
      3          typed/rackunit)
      4 
      5 (let ()
      6   (define result
      7     (worklist (list (list 7)
      8                     (list))
      9               [(λ ([x : Integer])
     10                  (list (number->string x)
     11                        (list (if (> x 0) (sub1 x) 0))
     12                        (list (string->symbol
     13                               (string-append "v" (number->string x))))))
     14                (λ ([x : Symbol])
     15                  (list (eq? 'v5 x)
     16                        (list 10)
     17                        (list 'xyz)))]
     18               (Integer String)
     19               (Symbol Boolean)))
     20   (ann result (List (HashTable Symbol Boolean) (HashTable Integer String)))
     21   (check-equal?
     22    result
     23    '(#hash((v0 . #f)
     24            (v1 . #f)
     25            (v2 . #f)
     26            (v3 . #f)
     27            (v4 . #f)
     28            (v5 . #t)
     29            (v6 . #f)
     30            (v7 . #f)
     31            (v8 . #f)
     32            (v9 . #f)
     33            (v10 . #f)
     34            (xyz . #f))
     35      #hash((0 . "0")
     36            (1 . "1")
     37            (2 . "2")
     38            (3 . "3")
     39            (4 . "4")
     40            (5 . "5")
     41            (6 . "6")
     42            (7 . "7")
     43            (8 . "8")
     44            (9 . "9")
     45            (10 . "10")))))