aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test/test/lux/lang/type/check.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/test/test/lux/lang/type/check.lux22
1 files changed, 10 insertions, 12 deletions
diff --git a/stdlib/test/test/lux/lang/type/check.lux b/stdlib/test/test/lux/lang/type/check.lux
index 48a3f35cb..e10ac5514 100644
--- a/stdlib/test/test/lux/lang/type/check.lux
+++ b/stdlib/test/test/lux/lang/type/check.lux
@@ -32,8 +32,6 @@
(r.rec (function (_ gen-type)
($_ r.alt
(r.seq gen-name (r/wrap (list)))
- (r/wrap [])
- (r/wrap [])
(r.seq gen-type gen-type)
(r.seq gen-type gen-type)
(r.seq gen-type gen-type)
@@ -52,7 +50,7 @@
(#.Primitive name params)
(list.every? valid-type? params)
- (^or #.Void #.Unit (#.Ex id))
+ (#.Ex id)
true
(^template [<tag>]
@@ -90,9 +88,9 @@
(context: "Simple type-checking."
($_ seq
- (test "Unit and Void match themselves."
- (and (@.checks? Void Void)
- (@.checks? Unit Unit)))
+ (test "Top and Bottom match themselves."
+ (and (@.checks? Bottom Bottom)
+ (@.checks? Top Top)))
(test "Existential types only match with themselves."
(and (type-checks? (do @.Monad<Check>
@@ -166,28 +164,28 @@
(test "Can bind unbound type-vars by type-checking against them."
(and (type-checks? (do @.Monad<Check>
[[id var] @.var]
- (@.check var #.Unit)))
+ (@.check var .Top)))
(type-checks? (do @.Monad<Check>
[[id var] @.var]
- (@.check #.Unit var)))))
+ (@.check .Top var)))))
(test "Cannot rebind already bound type-vars."
(not (type-checks? (do @.Monad<Check>
[[id var] @.var
- _ (@.check var #.Unit)]
- (@.check var #.Void)))))
+ _ (@.check var .Bool)]
+ (@.check var .Nat)))))
(test "If the type bound to a var is a super-type to another, then the var is also a super-type."
(type-checks? (do @.Monad<Check>
[[id var] @.var
_ (@.check var Top)]
- (@.check var #.Unit))))
+ (@.check var .Bool))))
(test "If the type bound to a var is a sub-type of another, then the var is also a sub-type."
(type-checks? (do @.Monad<Check>
[[id var] @.var
_ (@.check var Bottom)]
- (@.check #.Unit var))))
+ (@.check .Bool var))))
))
(def: (build-ring num-connections)