Skip to content

Commit e843686

Browse files
committed
add tests
1 parent ff7f9e9 commit e843686

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

typed-racket-test/unit-tests/typecheck-tests.rkt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,19 @@
13661366
(define: x : Any 7)
13671367
(if (box? x) (unbox x) (+ 1)))
13681368
Univ]
1369+
[tc-e (if (zero? (random 2)) (box "hello") (box 'hello))
1370+
(-box -Bottom (t:Un -String -Symbol))]
1371+
[tc-e (unbox (if (zero? (random 2)) (box "hello") (box 'hello)))
1372+
(t:Un -String -Symbol)]
1373+
[tc-e (if (zero? (random 2)) ((inst box Natural) 3) ((inst box Integer) -5))
1374+
(-box -Nat -Int)]
1375+
[tc-e (unbox (if (zero? (random 2)) ((inst box Natural) 3) ((inst box Integer) -5)))
1376+
-Int]
1377+
[tc-e (set-box!
1378+
(if (zero? (random 2)) ((inst box Natural) 3) ((inst box Integer) -5))
1379+
1)
1380+
-Void]
1381+
[tc-err (set-box! (if (zero? (random 2)) ((inst box Natural) 3) ((inst box Integer) -5)) -1)]
13691382
[tc-e (floor 1/2) -Nat]
13701383
[tc-e (ceiling 1/2) -PosInt]
13711384
[tc-e (truncate 0.5) -NonNegFlonum]

0 commit comments

Comments
 (0)