aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2018-05-20 21:04:03 -0400
committerEduardo Julian2018-05-20 21:04:03 -0400
commit14e96f5e5dad439383d63e60a52169cc2e7aaa5c (patch)
tree606398bbf6742a476a2599d9b25c184c71eae5c7 /stdlib/test
parent19d38211c33faf6d5fe01665982d696643f60051 (diff)
- Re-named "Top" to "Any", and "Bottom" to "Nothing".
- Removed some modules that should have been deleted before.
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/concurrency/frp.lux2
-rw-r--r--stdlib/test/test/lux/concurrency/semaphore.lux6
-rw-r--r--stdlib/test/test/lux/control/parser.lux2
-rw-r--r--stdlib/test/test/lux/control/region.lux2
-rw-r--r--stdlib/test/test/lux/lang/analysis/primitive.lux4
-rw-r--r--stdlib/test/test/lux/lang/type.lux4
-rw-r--r--stdlib/test/test/lux/lang/type/check.lux32
-rw-r--r--stdlib/test/test/lux/type/object/interface.lux4
-rw-r--r--stdlib/test/test/lux/type/object/protocol.lux24
-rw-r--r--stdlib/test/test/lux/world/blob.lux2
10 files changed, 41 insertions, 41 deletions
diff --git a/stdlib/test/test/lux/concurrency/frp.lux b/stdlib/test/test/lux/concurrency/frp.lux
index 527fafb36..6de1634ec 100644
--- a/stdlib/test/test/lux/concurrency/frp.lux
+++ b/stdlib/test/test/lux/concurrency/frp.lux
@@ -11,7 +11,7 @@
lux/test)
(def: (write! values channel)
- (All [a] (-> (List a) (Channel a) (IO Top)))
+ (All [a] (-> (List a) (Channel a) (IO Any)))
(do io.Monad<IO>
[_ (monad.map @ (frp.publish channel) values)]
(wrap [])))
diff --git a/stdlib/test/test/lux/concurrency/semaphore.lux b/stdlib/test/test/lux/concurrency/semaphore.lux
index af025dbb5..b360426c5 100644
--- a/stdlib/test/test/lux/concurrency/semaphore.lux
+++ b/stdlib/test/test/lux/concurrency/semaphore.lux
@@ -13,7 +13,7 @@
lux/test)
(def: (wait-many-times times semaphore)
- (-> Nat /.Semaphore (Promise Top))
+ (-> Nat /.Semaphore (Promise Any))
(loop [steps times]
(if (n/> +0 steps)
(do promise.Monad<Promise>
@@ -44,7 +44,7 @@
true)))))
(let [semaphore (/.semaphore open-positions)]
(wrap (do promise.Monad<Promise>
- [_ (: (Promise Top)
+ [_ (: (Promise Any)
(loop [steps (n/* +2 open-positions)]
(if (n/> +0 steps)
(do @
@@ -110,7 +110,7 @@
))))
(def: (waiter resource barrier id)
- (-> (Atom Text) /.Barrier Nat (Promise Top))
+ (-> (Atom Text) /.Barrier Nat (Promise Any))
(do promise.Monad<Promise>
[_ (/.block barrier)
#let [_ (io.run (atom.update (|>> (format (%n id))) resource))]]
diff --git a/stdlib/test/test/lux/control/parser.lux b/stdlib/test/test/lux/control/parser.lux
index bc26444ce..fd1f67724 100644
--- a/stdlib/test/test/lux/control/parser.lux
+++ b/stdlib/test/test/lux/control/parser.lux
@@ -25,7 +25,7 @@
_ false))
(def: (enforced? parser input)
- (All [s] (-> (&.Parser s Top) s Bool))
+ (All [s] (-> (&.Parser s Any) s Bool))
(case (&.run input parser)
(#E.Success [_ []])
true
diff --git a/stdlib/test/test/lux/control/region.lux b/stdlib/test/test/lux/control/region.lux
index a266218f9..48b2b1b7f 100644
--- a/stdlib/test/test/lux/control/region.lux
+++ b/stdlib/test/test/lux/control/region.lux
@@ -73,7 +73,7 @@
count-clean-up (function (_ value)
(do @
[_ (thread.update inc clean-up-counter)]
- (wrap (: (Error Top) (ex.throw oops [])))))]
+ (wrap (: (Error Any) (ex.throw oops [])))))]
outcome (/.run @
(do (/.Monad<Region> @)
[_ (monad.map @ (/.acquire @@ count-clean-up)
diff --git a/stdlib/test/test/lux/lang/analysis/primitive.lux b/stdlib/test/test/lux/lang/analysis/primitive.lux
index 8e4ca6dde..6e2a8aae9 100644
--- a/stdlib/test/test/lux/lang/analysis/primitive.lux
+++ b/stdlib/test/test/lux/lang/analysis/primitive.lux
@@ -29,7 +29,7 @@
(~~ (do-template [<type> <code-wrapper> <value-gen>]
[(r.seq (r/wrap <type>) (r/map <code-wrapper> <value-gen>))]
- [Top code.tuple (r.list +0 ..unit)]
+ [Any code.tuple (r.list +0 ..unit)]
[Bool code.bool r.bool]
[Nat code.nat r.nat]
[Int code.int r.int]
@@ -58,7 +58,7 @@
(context: "Primitives"
($_ seq
(test "Can analyse unit."
- (|> (infer-primitive Top (..analyse (' [])))
+ (|> (infer-primitive Any (..analyse (' [])))
(case> (^ (#e.Success (#analysis.Primitive (#analysis.Unit output))))
(is? [] output)
diff --git a/stdlib/test/test/lux/lang/type.lux b/stdlib/test/test/lux/lang/type.lux
index be888d321..22cd568ee 100644
--- a/stdlib/test/test/lux/lang/type.lux
+++ b/stdlib/test/test/lux/lang/type.lux
@@ -102,8 +102,8 @@
(and (L/= (list) members)
(L/= (list <unit>) flat)))))]
- ["variant" &.variant &.flatten-variant Bottom]
- ["tuple" &.tuple &.flatten-tuple Top]
+ ["variant" &.variant &.flatten-variant Nothing]
+ ["tuple" &.tuple &.flatten-tuple Any]
)]
($_ seq
<struct-tests>
diff --git a/stdlib/test/test/lux/lang/type/check.lux b/stdlib/test/test/lux/lang/type/check.lux
index b384ad2ef..57285c91c 100644
--- a/stdlib/test/test/lux/lang/type/check.lux
+++ b/stdlib/test/test/lux/lang/type/check.lux
@@ -74,23 +74,23 @@
false))
## [Tests]
-(context: "Top and Bottom."
+(context: "Any and Nothing."
(<| (times +100)
(do @
[sample (|> gen-type (r.filter valid-type?))]
($_ seq
- (test "Top is the super-type of everything."
- (@.checks? Top sample))
+ (test "Any is the super-type of everything."
+ (@.checks? Any sample))
- (test "Bottom is the sub-type of everything."
- (@.checks? sample Bottom))
+ (test "Nothing is the sub-type of everything."
+ (@.checks? sample Nothing))
))))
(context: "Simple type-checking."
($_ seq
- (test "Top and Bottom match themselves."
- (and (@.checks? Bottom Bottom)
- (@.checks? Top Top)))
+ (test "Any and Nothing match themselves."
+ (and (@.checks? Nothing Nothing)
+ (@.checks? Any Any)))
(test "Existential types only match with themselves."
(and (type-checks? (do @.Monad<Check>
@@ -116,10 +116,10 @@
(#.Named ["module" "name"] exT))))))
(test "Functions are covariant on inputs and contravariant on outputs."
- (and (@.checks? (#.Function Bottom Top)
- (#.Function Top Bottom))
- (not (@.checks? (#.Function Top Bottom)
- (#.Function Bottom Top)))))
+ (and (@.checks? (#.Function Nothing Any)
+ (#.Function Any Nothing))
+ (not (@.checks? (#.Function Any Nothing)
+ (#.Function Nothing Any)))))
))
(context: "Type application."
@@ -164,10 +164,10 @@
(test "Can bind unbound type-vars by type-checking against them."
(and (type-checks? (do @.Monad<Check>
[[id var] @.var]
- (@.check var .Top)))
+ (@.check var .Any)))
(type-checks? (do @.Monad<Check>
[[id var] @.var]
- (@.check .Top var)))))
+ (@.check .Any var)))))
(test "Cannot rebind already bound type-vars."
(not (type-checks? (do @.Monad<Check>
@@ -178,13 +178,13 @@
(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 Any)]
(@.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 var Nothing)]
(@.check .Bool var))))
))
diff --git a/stdlib/test/test/lux/type/object/interface.lux b/stdlib/test/test/lux/type/object/interface.lux
index f74d32e2a..7e2bddcdb 100644
--- a/stdlib/test/test/lux/type/object/interface.lux
+++ b/stdlib/test/test/lux/type/object/interface.lux
@@ -23,7 +23,7 @@
(class: NatRC Resettable-Counter
#super NatC
- Top
+ Any
(def: reset
(set@Counter +0)))
@@ -48,7 +48,7 @@
(class: (ListI a) (Iterable a)
#super (ListC a)
- Top
+ Any
(def: enumerate
get@Collection))
diff --git a/stdlib/test/test/lux/type/object/protocol.lux b/stdlib/test/test/lux/type/object/protocol.lux
index fcb53d3b1..58e4f6fcd 100644
--- a/stdlib/test/test/lux/type/object/protocol.lux
+++ b/stdlib/test/test/lux/type/object/protocol.lux
@@ -3,10 +3,10 @@
(lux (data text/format)
(type (object protocol))))
-(type: Counter (Object (Method Top Nat)))
+(type: Counter (Object (Method Any Nat)))
(def: (count [tick return] state)
- (Class Nat (Method Top Nat))
+ (Class Nat (Method Any Nat))
(let [state' (inc state)]
[(return state') state']))
@@ -48,20 +48,20 @@
(read [] a))
(def: (readM [tick return] state)
- (All [s] (Class s (Method Top s)))
+ (All [s] (Class s (Method Any s)))
[(return state) state])
(protocol: (Add n)
- (+ n Top)
- (- n Top))
+ (+ n Any)
+ (- n Any))
(protocol: (Mul n)
- (* n Top)
- (/ n Top))
+ (* n Any)
+ (/ n Any))
(do-template [<name> <op>]
[(def: (<name> [diff return] state)
- (Class Nat (Method Nat Top))
+ (Class Nat (Method Nat Any))
[(return []) (<op> diff state)])]
[+M n/+]
@@ -108,11 +108,11 @@
(numberO (+0 (read []))))
(def: _test3
- [Top NatO]
+ [Any NatO]
(numberO (+1 (+0 (+ +123)))))
(def: _test4
- [Top NatO]
+ [Any NatO]
(numberO (+1 (+1 (* +123)))))
## TODO: Fix when new-luxc is the official compiler.
@@ -121,9 +121,9 @@
## (numberO (^read (read []))))
## (def: _test3
-## [Top NatO]
+## [Any NatO]
## (numberO (^add (+ +123))))
## (def: _test4
-## [Top NatO]
+## [Any NatO]
## (numberO (^mul (* +123))))
diff --git a/stdlib/test/test/lux/world/blob.lux b/stdlib/test/test/lux/world/blob.lux
index e1c77552b..a74fb20e0 100644
--- a/stdlib/test/test/lux/world/blob.lux
+++ b/stdlib/test/test/lux/world/blob.lux
@@ -33,7 +33,7 @@
(:: r.Monad<Random> wrap output)))))
(def: (bits-io bytes read write value)
- (-> Nat (-> Nat /.Blob (e.Error Nat)) (-> Nat Nat /.Blob (e.Error Top)) Nat Bool)
+ (-> Nat (-> Nat /.Blob (e.Error Nat)) (-> Nat Nat /.Blob (e.Error Any)) Nat Bool)
(let [blob (/.create +8)
bits (n/* +8 bytes)
capped-value (|> +1 (bit.left-shift bits) dec (bit.and value))]