summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/012/compile.tl2
-rw-r--r--tests/012/typecase.tl18
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/012/compile.tl b/tests/012/compile.tl
index d0c4913e..9b22d92a 100644
--- a/tests/012/compile.tl
+++ b/tests/012/compile.tl
@@ -5,7 +5,7 @@
(each ((f '#"aseq ashwin circ cont defset except \
fini ifa man-or-boy oop-mi oop-seq oop \
- parse syms quasi quine seq stslot const"))
+ parse syms quasi quine seq stslot const type"))
(let ((exf `@{%this-dir%}/@f.expected`))
(when (path-exists-p exf)
(file-append-string %expected-file%
diff --git a/tests/012/typecase.tl b/tests/012/typecase.tl
new file mode 100644
index 00000000..97b3da48
--- /dev/null
+++ b/tests/012/typecase.tl
@@ -0,0 +1,18 @@
+(load "../common")
+
+(mtest
+ (typecase) :error
+ (typecase nil) nil
+ (typecase nil a) :error
+ (typecase 0 (symbol 1)) nil
+ (typecase 0 (integer 1)) 1
+ (typecase 0 (integer 1) (integer 2)) 1
+ (typecase 0 (t 3) (integer 1)) 3)
+
+(mtest
+ (etypecase) :error
+ (etypecase nil) :error
+ (etypecase nil a) :error
+ (etypecase 0 (string 1)) :error
+ (etypecase 0 (string 1) (integer 2)) 2
+ (etypecase 0 (string 1) (t 2)) 2)