diff options
Diffstat (limited to 'stdlib/test')
59 files changed, 339 insertions, 339 deletions
diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux index 4f1a810c2..a4730e2ef 100644 --- a/stdlib/test/test/lux.lux +++ b/stdlib/test/test/lux.lux @@ -165,17 +165,17 @@ (test "Can create lists easily through macros." (and (case (list 1 2 3) (#.Cons 1 (#.Cons 2 (#.Cons 3 #.Nil))) - true + #1 _ - false) + #0) (case (list& 1 2 3 (list 4 5 6)) (#.Cons 1 (#.Cons 2 (#.Cons 3 (#.Cons 4 (#.Cons 5 (#.Cons 6 #.Nil)))))) - true + #1 _ - false))) + #0))) (test "Can have defaults for Maybe values." (and (is? "yolo" (maybe.default "yolo" @@ -200,9 +200,9 @@ (context: "Cross-platform support." ($_ seq (test "Can provide default in case there is no particular platform support." - (for {"" false} - true)) + (for {"" #0} + #1)) (test "Can pick code depending on the platform being targeted." - (for {"JVM" true - "JS" true} - false)))) + (for {"JVM" #1 + "JS" #1} + #0)))) diff --git a/stdlib/test/test/lux/cli.lux b/stdlib/test/test/lux/cli.lux index 208b5b1b2..0bcdb785e 100644 --- a/stdlib/test/test/lux/cli.lux +++ b/stdlib/test/test/lux/cli.lux @@ -32,31 +32,31 @@ (test "Can read any argument." (|> (/.run (list yes) /.any) (case> (#E.Error _) - false + #0 (#E.Success arg) (text/= arg yes)))) (test "Can test tokens." (and (|> (/.run (list yes) (/.this yes)) - (case> (#E.Error _) false (#E.Success _) true)) + (case> (#E.Error _) #0 (#E.Success _) #1)) (|> (/.run (list no) (/.this yes)) - (case> (#E.Error _) true (#E.Success _) false)))) + (case> (#E.Error _) #1 (#E.Success _) #0)))) (test "Can use custom token parsers." (|> (/.run (list yes) (/.parse Nat/decode)) (case> (#E.Error _) - false + #0 (#E.Success parsed) (text/= (Nat/encode parsed) yes)))) (test "Can query if there are any more inputs." (and (|> (/.run (list) /.end) - (case> (#E.Success []) true _ false)) + (case> (#E.Success []) #1 _ #0)) (|> (/.run (list yes) (p.not /.end)) - (case> (#E.Success []) false _ true)))) + (case> (#E.Success []) #0 _ #1)))) (test "Can parse CLI input anywhere." (|> (/.run (list.concat (list pre-ignore (list yes) post-ignore)) (|> (/.somewhere (/.this yes)) (p.before (p.some /.any)))) - (case> (#E.Error _) false (#E.Success _) true))) + (case> (#E.Error _) #0 (#E.Success _) #1))) )))) diff --git a/stdlib/test/test/lux/concurrency/actor.lux b/stdlib/test/test/lux/concurrency/actor.lux index 1bb6b5b0b..a4f2ae234 100644 --- a/stdlib/test/test/lux/concurrency/actor.lux +++ b/stdlib/test/test/lux/concurrency/actor.lux @@ -72,5 +72,5 @@ outcome (#e.Error error) - false)))) + #0)))) )) diff --git a/stdlib/test/test/lux/concurrency/promise.lux b/stdlib/test/test/lux/concurrency/promise.lux index 29bab782c..0aae405ab 100644 --- a/stdlib/test/test/lux/concurrency/promise.lux +++ b/stdlib/test/test/lux/concurrency/promise.lux @@ -17,60 +17,60 @@ (context: "Promises" ($_ seq (wrap (do &.Monad<Promise> - [running? (&.future (io true))] + [running? (&.future (io #1))] (assert "Can run IO actions in separate threads." running?))) (wrap (do &.Monad<Promise> [_ (&.wait +500)] (assert "Can wait for a specified amount of time." - true))) + #1))) (wrap (do &.Monad<Promise> - [[left right] (&.seq (&.future (io true)) - (&.future (io false)))] + [[left right] (&.seq (&.future (io #1)) + (&.future (io #0)))] (assert "Can combine promises sequentially." (and left (not right))))) (wrap (do &.Monad<Promise> - [?left (&.alt (&.delay +100 true) - (&.delay +200 false)) - ?right (&.alt (&.delay +200 true) - (&.delay +100 false))] + [?left (&.alt (&.delay +100 #1) + (&.delay +200 #0)) + ?right (&.alt (&.delay +200 #1) + (&.delay +100 #0))] (assert "Can combine promises alternatively." (case [?left ?right] - [(#.Left true) (#.Right false)] - true + [(#.Left #1) (#.Right #0)] + #1 _ - false)))) + #0)))) (wrap (do &.Monad<Promise> - [?left (&.either (&.delay +100 true) - (&.delay +200 false)) - ?right (&.either (&.delay +200 true) - (&.delay +100 false))] + [?left (&.either (&.delay +100 #1) + (&.delay +200 #0)) + ?right (&.either (&.delay +200 #1) + (&.delay +100 #0))] (assert "Can combine promises alternatively [Part 2]." (and ?left (not ?right))))) (test "Can poll a promise for its value." - (and (|> (&.poll (&/wrap true)) - (case> (#.Some true) true _ false)) - (|> (&.poll (&.delay +200 true)) - (case> #.None true _ false)))) + (and (|> (&.poll (&/wrap #1)) + (case> (#.Some #1) #1 _ #0)) + (|> (&.poll (&.delay +200 #1)) + (case> #.None #1 _ #0)))) (test "Cannot re-resolve a resolved promise." - (and (not (io.run (&.resolve false (&/wrap true)))) - (io.run (&.resolve true (: (&.Promise Bit) (&.promise #.None)))))) + (and (not (io.run (&.resolve #0 (&/wrap #1)))) + (io.run (&.resolve #1 (: (&.Promise Bit) (&.promise #.None)))))) (wrap (do &.Monad<Promise> - [?none (&.time-out +100 (&.delay +200 true)) - ?some (&.time-out +200 (&.delay +100 true))] + [?none (&.time-out +100 (&.delay +200 #1)) + ?some (&.time-out +200 (&.delay +100 #1))] (assert "Can establish maximum waiting times for promises to be fulfilled." (case [?none ?some] - [#.None (#.Some true)] - true + [#.None (#.Some #1)] + #1 _ - false)))) + #0)))) )) diff --git a/stdlib/test/test/lux/concurrency/semaphore.lux b/stdlib/test/test/lux/concurrency/semaphore.lux index 8a5c1cbce..7eadd5ac7 100644 --- a/stdlib/test/test/lux/concurrency/semaphore.lux +++ b/stdlib/test/test/lux/concurrency/semaphore.lux @@ -34,7 +34,7 @@ (wrap (do promise.Monad<Promise> [_ (wait-many-times open-positions semaphore)] (assert "Can wait on a semaphore up to the number of open positions without blocking." - true)))) + #1)))) (let [semaphore (/.semaphore open-positions)] (wrap (do promise.Monad<Promise> [result (<| (promise.time-out +100) @@ -42,10 +42,10 @@ (assert "Waiting on a semaphore more than the number of open positions blocks the process." (case result (#.Some _) - false + #0 #.None - true))))) + #1))))) (let [semaphore (/.semaphore open-positions)] (wrap (do promise.Monad<Promise> [_ (: (Promise Any) @@ -57,7 +57,7 @@ (recur (dec steps))) (wrap []))))] (assert "Signaling a semaphore replenishes its open positions." - true)))) + #1)))) (let [semaphore (/.semaphore open-positions)] (wrap (do promise.Monad<Promise> [#let [resource (atom.atom "") diff --git a/stdlib/test/test/lux/control/equivalence.lux b/stdlib/test/test/lux/control/equivalence.lux index 5206e892d..7c45e90e0 100644 --- a/stdlib/test/test/lux/control/equivalence.lux +++ b/stdlib/test/test/lux/control/equivalence.lux @@ -18,4 +18,4 @@ (test "Equivalence is symmetric." (if (:: Equivalence<a> = sample another) (:: Equivalence<a> = another sample) - true))))) + #1))))) diff --git a/stdlib/test/test/lux/control/parser.lux b/stdlib/test/test/lux/control/parser.lux index 6028eed1a..70cf4cfbe 100644 --- a/stdlib/test/test/lux/control/parser.lux +++ b/stdlib/test/test/lux/control/parser.lux @@ -18,52 +18,52 @@ (def: (should-fail input) (All [a] (-> (Error a) Bit)) (case input - (#error.Error _) true - _ false)) + (#error.Error _) #1 + _ #0)) (def: (enforced? parser input) (All [s] (-> (&.Parser s Any) s Bit)) (case (&.run input parser) (#error.Success [_ []]) - true + #1 _ - false)) + #0)) (def: (found? parser input) (All [s] (-> (&.Parser s Bit) s Bit)) (case (&.run input parser) - (#error.Success [_ true]) - true + (#error.Success [_ #1]) + #1 _ - false)) + #0)) (def: (fails? input) (All [a] (-> (Error a) Bit)) (case input (#error.Error _) - true + #1 _ - false)) + #0)) (syntax: (match pattern input) (wrap (list (` (case (~ input) (^ (#error.Success [(~' _) (~ pattern)])) - true + #1 (~' _) - false))))) + #0))))) ## [Tests] (context: "Assertions" (test "Can make assertions while parsing." (and (match [] - (&.run (list (code.bit true) (code.int 123)) - (&.assert "yolo" true))) - (fails? (&.run (list (code.bit true) (code.int 123)) - (&.assert "yolo" false)))))) + (&.run (list (code.bit #1) (code.int 123)) + (&.assert "yolo" #1))) + (fails? (&.run (list (code.bit #1) (code.int 123)) + (&.assert "yolo" #0)))))) (context: "Combinators [Part 1]" ($_ seq @@ -105,14 +105,14 @@ (match -123 (&.run (list (code.int -123) (code.int 456) (code.int 789)) (&.either positive s.int))) - (fails? (&.run (list (code.bit true) (code.int 456) (code.int 789)) + (fails? (&.run (list (code.bit #1) (code.int 456) (code.int 789)) (&.either positive s.int)))))) (test "Can create the opposite/negation of any parser." (and (fails? (&.run (list (code.int 123) (code.int 456) (code.int 789)) (&.not s.int))) (match [] - (&.run (list (code.bit true) (code.int 456) (code.int 789)) + (&.run (list (code.bit #1) (code.int 456) (code.int 789)) (&.not s.int))))) )) diff --git a/stdlib/test/test/lux/control/reader.lux b/stdlib/test/test/lux/control/reader.lux index bc7905f37..560e6565c 100644 --- a/stdlib/test/test/lux/control/reader.lux +++ b/stdlib/test/test/lux/control/reader.lux @@ -32,6 +32,6 @@ (wrap (i/+ a b)))) (&.run "") io.run - (case> 579 true - _ false))) + (case> 579 #1 + _ #0))) )) diff --git a/stdlib/test/test/lux/control/region.lux b/stdlib/test/test/lux/control/region.lux index 544b42982..266fd2733 100644 --- a/stdlib/test/test/lux/control/region.lux +++ b/stdlib/test/test/lux/control/region.lux @@ -23,8 +23,8 @@ (#e.Success _) <success> (#e.Error _) <error>))] - [success? true false] - [error? false true] + [success? #1 #0] + [error? #0 #1] ) (context: "Regions." diff --git a/stdlib/test/test/lux/control/state.lux b/stdlib/test/test/lux/control/state.lux index c39be3197..3d8c2fd10 100644 --- a/stdlib/test/test/lux/control/state.lux +++ b/stdlib/test/test/lux/control/state.lux @@ -102,7 +102,7 @@ [state &.get] (wrap (n/< limit state)))]] ($_ seq - (test "'while' will only execute if the condition is true." + (test "'while' will only execute if the condition is #1." (|> (&.while condition (&.update inc)) (&.run +0) (case> [state' output'] diff --git a/stdlib/test/test/lux/control/writer.lux b/stdlib/test/test/lux/control/writer.lux index 6cf50d2bd..8f44f6784 100644 --- a/stdlib/test/test/lux/control/writer.lux +++ b/stdlib/test/test/lux/control/writer.lux @@ -41,6 +41,6 @@ [a (lift (io/wrap 123)) b (wrap 456)] (wrap (i/+ a b)))) - (case> ["" 579] true - _ false))) + (case> ["" 579] #1 + _ #0))) )) diff --git a/stdlib/test/test/lux/data/bit.lux b/stdlib/test/test/lux/data/bit.lux index f9ab9551f..8d0a93a83 100644 --- a/stdlib/test/test/lux/data/bit.lux +++ b/stdlib/test/test/lux/data/bit.lux @@ -34,5 +34,5 @@ (:: Equivalence<Bit> = value dec-value) (#.Left _) - false) + #0) ))))) diff --git a/stdlib/test/test/lux/data/collection/array.lux b/stdlib/test/test/lux/data/collection/array.lux index f0f72a14d..91b67b5c5 100644 --- a/stdlib/test/test/lux/data/collection/array.lux +++ b/stdlib/test/test/lux/data/collection/array.lux @@ -64,12 +64,12 @@ ($_ seq (test "Shouldn't be able to find a value in an unoccupied cell." (case (@.read idx (@.delete idx array)) - (#.Some _) false - #.None true)) + (#.Some _) #0 + #.None #1)) (test "You should be able to access values put into the array." (case (@.read idx (@.write idx value array)) (#.Some value') (n/= value' value) - #.None false)) + #.None #0)) (test "All cells should be occupied on a full array." (and (n/= size (@.occupied array)) (n/= +0 (@.vacant array)))) @@ -90,15 +90,15 @@ ($_ seq (test "Can find values inside arrays." (|> (@.find n/even? array) - (case> (#.Some _) true - #.None false))) + (case> (#.Some _) #1 + #.None #0))) (test "Can find values inside arrays (with access to indices)." (|> (@.find+ (function (_ idx n) (and (n/even? n) (n/< size idx))) array) - (case> (#.Some _) true - #.None false))))))) + (case> (#.Some _) #1 + #.None #0))))))) (context: "Functor" (<| (times +100) diff --git a/stdlib/test/test/lux/data/collection/dictionary.lux b/stdlib/test/test/lux/data/collection/dictionary.lux index b0ad15d7b..f79327c29 100644 --- a/stdlib/test/test/lux/data/collection/dictionary.lux +++ b/stdlib/test/test/lux/data/collection/dictionary.lux @@ -44,31 +44,31 @@ (test "Should be able to get every key." (list.every? (function (_ key) (case (&.get key dict) - (#.Some _) true - _ false)) + (#.Some _) #1 + _ #0)) (&.keys dict))) (test "Shouldn't be able to access non-existant keys." (case (&.get non-key dict) - (#.Some _) false - _ true)) + (#.Some _) #0 + _ #1)) (test "Should be able to put and then get a value." (case (&.get non-key (&.put non-key test-val dict)) (#.Some v) (n/= test-val v) - _ true)) + _ #1)) (test "Should be able to put~ and then get a value." (case (&.get non-key (&.put~ non-key test-val dict)) (#.Some v) (n/= test-val v) - _ true)) + _ #1)) (test "Shouldn't be able to put~ an existing key." (or (n/= +0 size) (let [first-key (|> dict &.keys list.head maybe.assume)] (case (&.get first-key (&.put~ first-key test-val dict)) (#.Some v) (not (n/= test-val v)) - _ true)))) + _ #1)))) (test "Removing a key should make it's value inaccessible." (let [base (&.put non-key test-val dict)] @@ -83,7 +83,7 @@ (n/= (inc x) y) _ - false))) + #0))) (test "Additions and removals to a Dictionary should affect its size." (let [plus (&.put non-key test-val dict) diff --git a/stdlib/test/test/lux/data/collection/dictionary/ordered.lux b/stdlib/test/test/lux/data/collection/dictionary/ordered.lux index 4626886e9..64a51b413 100644 --- a/stdlib/test/test/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/test/test/lux/data/collection/dictionary/ordered.lux @@ -39,24 +39,24 @@ (test "Can query value for minimum key." (case [(&.min sample) (list.head sorted-values)] [#.None #.None] - true + #1 [(#.Some reference) (#.Some sample)] (n/= reference sample) _ - false)) + #0)) (test "Can query value for maximum key." (case [(&.max sample) (list.last sorted-values)] [#.None #.None] - true + #1 [(#.Some reference) (#.Some sample)] (n/= reference sample) _ - false)) + #0)) (test "Converting dictionaries to/from lists cannot change their values." (|> sample @@ -87,6 +87,6 @@ (n/= extra-value found) _ - false))) + #0))) )) )))) diff --git a/stdlib/test/test/lux/data/collection/list.lux b/stdlib/test/test/lux/data/collection/list.lux index 0945a9abb..f5565c455 100644 --- a/stdlib/test/test/lux/data/collection/list.lux +++ b/stdlib/test/test/lux/data/collection/list.lux @@ -234,5 +234,5 @@ [a (lift (io/wrap 123)) b (wrap 456)] (wrap (i/+ a b)))) - (case> (^ (list 579)) true - _ false))))) + (case> (^ (list 579)) #1 + _ #0))))) diff --git a/stdlib/test/test/lux/data/collection/queue.lux b/stdlib/test/test/lux/data/collection/queue.lux index ebb730d58..89f674462 100644 --- a/stdlib/test/test/lux/data/collection/queue.lux +++ b/stdlib/test/test/lux/data/collection/queue.lux @@ -39,7 +39,7 @@ (test "I can always peek at a non-empty queue." (case (&.peek sample) #.None (&.empty? sample) - (#.Some _) true)) + (#.Some _) #1)) (test "I can query whether an element belongs to a queue." (and (not (&.member? number.Equivalence<Nat> sample non-member)) diff --git a/stdlib/test/test/lux/data/collection/set/ordered.lux b/stdlib/test/test/lux/data/collection/set/ordered.lux index 97127a3f3..261eebbb1 100644 --- a/stdlib/test/test/lux/data/collection/set/ordered.lux +++ b/stdlib/test/test/lux/data/collection/set/ordered.lux @@ -40,24 +40,24 @@ (test "Can query minimum value." (case [(&.min setL) minL] [#.None #.None] - true + #1 [(#.Some reference) (#.Some sample)] (n/= reference sample) _ - false)) + #0)) (test "Can query maximum value." (case [(&.max setL) maxL] [#.None #.None] - true + #1 [(#.Some reference) (#.Some sample)] (n/= reference sample) _ - false)) + #0)) (test "Converting sets to/from lists can't change their values." (|> setL diff --git a/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux b/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux index 26311fbd1..28c7ec0f9 100644 --- a/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux +++ b/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux @@ -75,7 +75,7 @@ (|> zipper &.down &.rightmost &.leftmost &.value (is? pre-val)) (|> zipper &.down &.right &.left &.value (is? pre-val)) (|> zipper &.down &.rightmost &.value (is? post-val)))) - true))) + #1))) (test "Can insert children around a node (unless it's root)." (let [zipper (&.zip sample)] @@ -94,10 +94,10 @@ (|> zipper &.down &.rightmost &.leftmost &.value (is? pre-val)) (|> zipper &.down &.right &.left &.value (is? pre-val)) (|> zipper &.down &.rightmost &.value (is? post-val)))) - (and (|> zipper (&.insert-left pre-val) (case> (#.Some _) false - #.None true)) - (|> zipper (&.insert-right post-val) (case> (#.Some _) false - #.None true)))))) + (and (|> zipper (&.insert-left pre-val) (case> (#.Some _) #0 + #.None #1)) + (|> zipper (&.insert-right post-val) (case> (#.Some _) #0 + #.None #1)))))) (test "Can set and update the value of a node." (|> sample &.zip (&.set new-val) &.value (n/= new-val))) @@ -122,8 +122,8 @@ (let [zipper (&.zip sample)] (if (&.branch? zipper) (and (|> zipper &.down &.root? not) - (|> zipper &.down &.remove (case> #.None false + (|> zipper &.down &.remove (case> #.None #0 (#.Some node) (&.root? node)))) - (|> zipper &.remove (case> #.None true - (#.Some _) false))))) + (|> zipper &.remove (case> #.None #1 + (#.Some _) #0))))) )))) diff --git a/stdlib/test/test/lux/data/error.lux b/stdlib/test/test/lux/data/error.lux index d86afc20b..7e64cc5ed 100644 --- a/stdlib/test/test/lux/data/error.lux +++ b/stdlib/test/test/lux/data/error.lux @@ -17,20 +17,20 @@ (test "Functor correctly handles both cases." (and (|> (: (&.Error Int) (#&.Success 10)) (&/map inc) - (case> (#&.Success 11) true _ false)) + (case> (#&.Success 11) #1 _ #0)) (|> (: (&.Error Int) (#&.Error "YOLO")) (&/map inc) - (case> (#&.Error "YOLO") true _ false)) + (case> (#&.Error "YOLO") #1 _ #0)) )) (test "Apply correctly handles both cases." (and (|> (&/wrap 20) - (case> (#&.Success 20) true _ false)) + (case> (#&.Success 20) #1 _ #0)) (|> (&/apply (&/wrap inc) (&/wrap 10)) - (case> (#&.Success 11) true _ false)) + (case> (#&.Success 11) #1 _ #0)) (|> (&/apply (&/wrap inc) (#&.Error "YOLO")) - (case> (#&.Error "YOLO") true _ false)))) + (case> (#&.Error "YOLO") #1 _ #0)))) (test "Monad correctly handles both cases." (and (|> (do &.Monad<Error> @@ -38,13 +38,13 @@ a (wrap 10) b (wrap 20)] (wrap (f a b))) - (case> (#&.Success 30) true _ false)) + (case> (#&.Success 30) #1 _ #0)) (|> (do &.Monad<Error> [f (wrap i/+) a (#&.Error "YOLO") b (wrap 20)] (wrap (f a b))) - (case> (#&.Error "YOLO") true _ false)) + (case> (#&.Error "YOLO") #1 _ #0)) )) ))) @@ -56,5 +56,5 @@ [a (lift (io/wrap 123)) b (wrap 456)] (wrap (i/+ a b)))) - (case> (#&.Success 579) true - _ false))))) + (case> (#&.Success 579) #1 + _ #0))))) diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index f648dce28..086c13ece 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -73,7 +73,7 @@ (@/= sample result) (#.Left _) - false))) + #0))) )))) (type: Variant @@ -149,7 +149,7 @@ (f/= left' right') _ - false))] + #0))] (and (:: bit.Equivalence<Bit> = (get@ #bit recL) (get@ #bit recR)) (f/= (get@ #frac recL) (get@ #frac recR)) (:: text.Equivalence<Text> = (get@ #text recL) (get@ #text recR)) @@ -182,4 +182,4 @@ (@/= sample result) (#e.Error error) - false)))))) + #0)))))) diff --git a/stdlib/test/test/lux/data/format/xml.lux b/stdlib/test/test/lux/data/format/xml.lux index b757fe7e6..350718f0f 100644 --- a/stdlib/test/test/lux/data/format/xml.lux +++ b/stdlib/test/test/lux/data/format/xml.lux @@ -75,7 +75,7 @@ (&/= sample result) (#.Left error) - false))) + #0))) )))) (context: "Parsing." @@ -92,27 +92,27 @@ (list/map (|>> #&.Text) children))]] ($_ seq (test "Can parse text." - (E.default false + (E.default #0 (do E.Monad<Error> [output (&.run (#&.Text text) &.text)] (wrap (text/= text output))))) (test "Can parse attributes." - (E.default false + (E.default #0 (do E.Monad<Error> [output (|> (&.attr attr) (p.before &.ignore) (&.run node))] (wrap (text/= value output))))) (test "Can parse nodes." - (E.default false + (E.default #0 (do E.Monad<Error> [_ (|> (&.node tag) (p.before &.ignore) (&.run node))] - (wrap true)))) + (wrap #1)))) (test "Can parse children." - (E.default false + (E.default #0 (do E.Monad<Error> [outputs (|> (&.children (p.some &.text)) (&.run node))] diff --git a/stdlib/test/test/lux/data/ident.lux b/stdlib/test/test/lux/data/ident.lux index 0f8133721..e0e37d7a8 100644 --- a/stdlib/test/test/lux/data/ident.lux +++ b/stdlib/test/test/lux/data/ident.lux @@ -49,12 +49,12 @@ (|> ident1 &/encode &/decode (case> (#.Right dec-ident) (&/= ident1 dec-ident) - _ false))) + _ #0))) (test "Encoding an ident without a module component results in text equal to the name of the ident." (if (text.empty? module1) (text/= name1 (&/encode ident1)) - true)) + #1)) )))) (context: "Ident-related macros." diff --git a/stdlib/test/test/lux/data/maybe.lux b/stdlib/test/test/lux/data/maybe.lux index 4401748cd..8e6680ad8 100644 --- a/stdlib/test/test/lux/data/maybe.lux +++ b/stdlib/test/test/lux/data/maybe.lux @@ -55,5 +55,5 @@ [a (lift (io/wrap 123)) b (wrap 456)] (wrap (i/+ a b)))) - (case> (#.Some 579) true - _ false))))) + (case> (#.Some 579) #1 + _ #0))))) diff --git a/stdlib/test/test/lux/data/number.lux b/stdlib/test/test/lux/data/number.lux index cc286dcd5..15bdbfd4c 100644 --- a/stdlib/test/test/lux/data/number.lux +++ b/stdlib/test/test/lux/data/number.lux @@ -84,10 +84,10 @@ (test "" (and (<= x (:: <Interval> bottom)) (>= x (:: <Interval> top)))))))] - ["Nat" r.nat Number<Nat> Order<Nat> Interval<Nat> (function (_ _) true)] - ["Int" r.int Number<Int> Order<Int> Interval<Int> (function (_ _) true)] + ["Nat" r.nat Number<Nat> Order<Nat> Interval<Nat> (function (_ _) #1)] + ["Int" r.int Number<Int> Order<Int> Interval<Int> (function (_ _) #1)] ## Both min and max values will be positive (thus, greater than zero) - ["Rev" r.rev Number<Rev> Order<Rev> Interval<Rev> (function (_ _) true)] + ["Rev" r.rev Number<Rev> Order<Rev> Interval<Rev> (function (_ _) #1)] ["Frac" r.frac Number<Frac> Order<Frac> Interval<Frac> (f/> 0.0)] ) @@ -104,18 +104,18 @@ (= x (compose x identity)) (= identity (compose identity identity)))))))] - ["Nat/Add" r.nat Number<Nat> Order<Nat> Add@Monoid<Nat> (n/% +1000) (function (_ _) true)] - ["Nat/Mul" r.nat Number<Nat> Order<Nat> Mul@Monoid<Nat> (n/% +1000) (function (_ _) true)] - ["Nat/Min" r.nat Number<Nat> Order<Nat> Min@Monoid<Nat> (n/% +1000) (function (_ _) true)] - ["Nat/Max" r.nat Number<Nat> Order<Nat> Max@Monoid<Nat> (n/% +1000) (function (_ _) true)] - ["Int/Add" r.int Number<Int> Order<Int> Add@Monoid<Int> (i/% 1000) (function (_ _) true)] - ["Int/Mul" r.int Number<Int> Order<Int> Mul@Monoid<Int> (i/% 1000) (function (_ _) true)] - ["Int/Min" r.int Number<Int> Order<Int> Min@Monoid<Int> (i/% 1000) (function (_ _) true)] - ["Int/Max" r.int Number<Int> Order<Int> Max@Monoid<Int> (i/% 1000) (function (_ _) true)] - ["Rev/Add" r.rev Number<Rev> Order<Rev> Add@Monoid<Rev> (r/% .125) (function (_ _) true)] - ["Rev/Mul" r.rev Number<Rev> Order<Rev> Mul@Monoid<Rev> (r/% .125) (function (_ _) true)] - ["Rev/Min" r.rev Number<Rev> Order<Rev> Min@Monoid<Rev> (r/% .125) (function (_ _) true)] - ["Rev/Max" r.rev Number<Rev> Order<Rev> Max@Monoid<Rev> (r/% .125) (function (_ _) true)] + ["Nat/Add" r.nat Number<Nat> Order<Nat> Add@Monoid<Nat> (n/% +1000) (function (_ _) #1)] + ["Nat/Mul" r.nat Number<Nat> Order<Nat> Mul@Monoid<Nat> (n/% +1000) (function (_ _) #1)] + ["Nat/Min" r.nat Number<Nat> Order<Nat> Min@Monoid<Nat> (n/% +1000) (function (_ _) #1)] + ["Nat/Max" r.nat Number<Nat> Order<Nat> Max@Monoid<Nat> (n/% +1000) (function (_ _) #1)] + ["Int/Add" r.int Number<Int> Order<Int> Add@Monoid<Int> (i/% 1000) (function (_ _) #1)] + ["Int/Mul" r.int Number<Int> Order<Int> Mul@Monoid<Int> (i/% 1000) (function (_ _) #1)] + ["Int/Min" r.int Number<Int> Order<Int> Min@Monoid<Int> (i/% 1000) (function (_ _) #1)] + ["Int/Max" r.int Number<Int> Order<Int> Max@Monoid<Int> (i/% 1000) (function (_ _) #1)] + ["Rev/Add" r.rev Number<Rev> Order<Rev> Add@Monoid<Rev> (r/% .125) (function (_ _) #1)] + ["Rev/Mul" r.rev Number<Rev> Order<Rev> Mul@Monoid<Rev> (r/% .125) (function (_ _) #1)] + ["Rev/Min" r.rev Number<Rev> Order<Rev> Min@Monoid<Rev> (r/% .125) (function (_ _) #1)] + ["Rev/Max" r.rev Number<Rev> Order<Rev> Max@Monoid<Rev> (r/% .125) (function (_ _) #1)] ["Frac/Add" r.frac Number<Frac> Order<Frac> Add@Monoid<Frac> (f/% 1000.0) (f/> 0.0)] ["Frac/Mul" r.frac Number<Frac> Order<Frac> Mul@Monoid<Frac> (f/% 1000.0) (f/> 0.0)] ["Frac/Min" r.frac Number<Frac> Order<Frac> Min@Monoid<Frac> (f/% 1000.0) (f/> 0.0)] @@ -135,7 +135,7 @@ (:: <Equivalence> = x x') (#.Left _) - false))))))] + #0))))))] ["Nat/Binary" r.nat Equivalence<Nat> Binary@Codec<Text,Nat>] ["Nat/Octal" r.nat Equivalence<Nat> Octal@Codec<Text,Nat>] diff --git a/stdlib/test/test/lux/data/number/ratio.lux b/stdlib/test/test/lux/data/number/ratio.lux index 0235a78b7..5be1942f2 100644 --- a/stdlib/test/test/lux/data/number/ratio.lux +++ b/stdlib/test/test/lux/data/number/ratio.lux @@ -113,4 +113,4 @@ (&.= sample output) _ - false)))))) + #0)))))) diff --git a/stdlib/test/test/lux/data/sum.lux b/stdlib/test/test/lux/data/sum.lux index 0cc9e36af..4f8cadac2 100644 --- a/stdlib/test/test/lux/data/sum.lux +++ b/stdlib/test/test/lux/data/sum.lux @@ -13,8 +13,8 @@ (let [(^open "List/") (list.Equivalence<List> text.Equivalence<Text>)] ($_ seq (test "Can inject values into Either." - (and (|> (left "Hello") (case> (+0 "Hello") true _ false)) - (|> (right "World") (case> (+1 "World") true _ false)))) + (and (|> (left "Hello") (case> (+0 "Hello") #1 _ #0)) + (|> (right "World") (case> (+1 "World") #1 _ #0)))) (test "Can discriminate eithers based on their cases." (let [[_lefts _rights] (partition (: (List (| Text Text)) diff --git a/stdlib/test/test/lux/data/text.lux b/stdlib/test/test/lux/data/text.lux index c75b1bacd..478fb8c39 100644 --- a/stdlib/test/test/lux/data/text.lux +++ b/stdlib/test/test/lux/data/text.lux @@ -53,7 +53,7 @@ (&.contains? char sample)) _ - false + #0 )) )))) @@ -83,7 +83,7 @@ (= sample (&.concat (list _l _r)))) _ - false)) + #0)) (|> [(&.clip +0 sizeL sample) (&.clip sizeL (&.size sample) sample) @@ -96,7 +96,7 @@ (= sample _f)) _ - false)) + #0)) ) )))) diff --git a/stdlib/test/test/lux/data/text/format.lux b/stdlib/test/test/lux/data/text/format.lux index 0d328cb0e..6c877da7b 100644 --- a/stdlib/test/test/lux/data/text/format.lux +++ b/stdlib/test/test/lux/data/text/format.lux @@ -13,11 +13,11 @@ (let [(^open "&/") text.Equivalence<Text>] ($_ seq (test "Can format common values simply." - (and (&/= "true" (%b true)) + (and (&/= "#1" (%b #1)) (&/= "+123" (%n +123)) (&/= "123" (%i 123)) (&/= "123.456" (%f 123.456)) (&/= ".5" (%r .5)) (&/= "\"YOLO\"" (%t "YOLO")) - (&/= "User-id: 123 -- Active: true" (format "User-id: " (%i 123) " -- Active: " (%b true))))) + (&/= "User-id: 123 -- Active: #1" (format "User-id: " (%i 123) " -- Active: " (%b #1))))) ))) diff --git a/stdlib/test/test/lux/data/text/lexer.lux b/stdlib/test/test/lux/data/text/lexer.lux index b02082357..cab364c59 100644 --- a/stdlib/test/test/lux/data/text/lexer.lux +++ b/stdlib/test/test/lux/data/text/lexer.lux @@ -20,8 +20,8 @@ (def: (should-fail input) (All [a] (-> (E.Error a) Bit)) (case input - (#.Left _) true - _ false)) + (#.Left _) #1 + _ #0)) (def: (should-passT test input) (-> Text (E.Error Text) Bit) @@ -30,7 +30,7 @@ (text/= test output) _ - false)) + #0)) (def: (should-passL test input) (-> (List Text) (E.Error (List Text)) Bit) @@ -40,7 +40,7 @@ (list/= test output) _ - false))) + #0))) (def: (should-passE test input) (-> (Either Text Text) (E.Error (Either Text Text)) Bit) @@ -54,10 +54,10 @@ (text/= test output) _ - false) + #0) _ - false)) + #0)) ## [Tests] (context: "End" @@ -65,12 +65,12 @@ (test "Can detect the end of the input." (|> (&.run "" &.end) - (case> (#.Right _) true _ false))) + (case> (#.Right _) #1 _ #0))) (test "Won't mistake non-empty text for no more input." (|> (&.run "YOLO" &.end) - (case> (#.Left _) true _ false))) + (case> (#.Left _) #1 _ #0))) )) (context: "Literals" @@ -84,10 +84,10 @@ (test "Can find literal text fragments." (and (|> (&.run sample (&.this sample)) - (case> (#.Right []) true _ false)) + (case> (#.Right []) #1 _ #0)) (|> (&.run non-sample (&.this sample)) - (case> (#.Left _) true _ false)))) + (case> (#.Left _) #1 _ #0)))) )))) (context: "Custom lexers" @@ -166,8 +166,8 @@ (test "Can combine lexers sequentially." (and (|> (&.run "YO" (p.seq &.any &.any)) - (case> (#.Right ["Y" "O"]) true - _ false)) + (case> (#.Right ["Y" "O"]) #1 + _ #0)) (should-fail (&.run "Y" (p.seq &.any &.any))))) @@ -191,9 +191,9 @@ (test "Can lex using arbitrary predicates." (and (should-passT "D" (&.run "D" - (&.satisfies (function (_ c) true)))) + (&.satisfies (function (_ c) #1)))) (should-fail (&.run "C" - (&.satisfies (function (_ c) false)))))) + (&.satisfies (function (_ c) #0)))))) (test "Can apply a lexer multiple times." (and (should-passT "0123456789ABCDEF" (&.run "0123456789ABCDEF" diff --git a/stdlib/test/test/lux/data/text/regex.lux b/stdlib/test/test/lux/data/text/regex.lux index ff09a55db..dd13cee12 100644 --- a/stdlib/test/test/lux/data/text/regex.lux +++ b/stdlib/test/test/lux/data/text/regex.lux @@ -26,7 +26,7 @@ (text/= parsed input) _ - false))) + #0))) (def: (should-passT test regex input) (-> Text (lexer.Lexer Text) Text Bit) @@ -35,20 +35,20 @@ (text/= test parsed) _ - false))) + #0))) (def: (should-fail regex input) (All [a] (-> (lexer.Lexer a) Text Bit)) (|> (lexer.run input regex) - (case> (#.Left _) true _ false))) + (case> (#.Left _) #1 _ #0))) (syntax: (should-check pattern regex input) (wrap (list (` (|> (lexer.run (~ input) (~ regex)) (case> (^ (#.Right (~ pattern))) - true + #1 (~' _) - false)))))) + #0)))))) ## [Tests] (context: "Regular Expressions [Basics]" @@ -285,4 +285,4 @@ _ (test "Cannot pattern-match using regular-expressions." - false))))) + #0))))) diff --git a/stdlib/test/test/lux/host.jvm.lux b/stdlib/test/test/lux/host.jvm.lux index d5469b9c2..5d233187d 100644 --- a/stdlib/test/test/lux/host.jvm.lux +++ b/stdlib/test/test/lux/host.jvm.lux @@ -35,7 +35,7 @@ (#private baz java/lang/Object) ## Methods (#public [] (new [value A]) [] - (exec (:= ::foo true) + (exec (:= ::foo #1) (:= ::bar value) (:= ::baz "") [])) @@ -92,7 +92,7 @@ (not (&.instance? Object (&.null))))) (test "Can run code in a \"synchronized\" block." - (&.synchronized "" true)) + (&.synchronized "" #1)) (test "Can access Class instances." (text/= "java.lang.Class" (Class::getName [] (&.class-for java/lang/Class)))) @@ -103,11 +103,11 @@ (test "Can safely convert nullable references into Maybe values." (and (|> (: (Maybe Object) (&.??? (&.null))) - (case> #.None true - _ false)) + (case> #.None #1 + _ #0)) (|> (: (Maybe Object) (&.??? "")) - (case> (#.Some _) true - _ false)))) + (case> (#.Some _) #1 + _ #0)))) )) (context: "Arrays" diff --git a/stdlib/test/test/lux/language/compiler/analysis/case.lux b/stdlib/test/test/lux/language/compiler/analysis/case.lux index 14b762271..adbacaa0e 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/case.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/case.lux @@ -47,7 +47,7 @@ (-> Bit (List [Code Code]) Code (r.Random (List Code))) (case inputC [_ (#.Bit _)] - (random/wrap (list (' true) (' false))) + (random/wrap (list (' #1) (' #0))) (^template [<tag> <gen> <wrapper>] [_ (<tag> _)] @@ -151,8 +151,8 @@ [outputT outputC] _primitive.primitive [heterogeneousT heterogeneousC] (r.filter (|>> product.left (check.checks? outputT) not) _primitive.primitive) - exhaustive-patterns (exhaustive-branches true variantTC inputC) - redundant-patterns (exhaustive-branches false variantTC inputC) + exhaustive-patterns (exhaustive-branches #1 variantTC inputC) + redundant-patterns (exhaustive-branches #0 variantTC inputC) redundancy-idx (|> r.nat (:: @ map (n/% (list.size redundant-patterns)))) heterogeneous-idx (|> r.nat (:: @ map (n/% (list.size exhaustive-patterns)))) #let [exhaustive-branchesC (list/map (branch outputC) @@ -172,10 +172,10 @@ (typeA.with-type outputT) analysis.with-scope (do compiler.Monad<Operation> - [_ (module.declare-tags variant-tags false + [_ (module.declare-tags variant-tags #0 (#.Named [module-name variant-name] (type.variant primitivesT))) - _ (module.declare-tags record-tags false + _ (module.declare-tags record-tags #0 (#.Named [module-name record-name] (type.tuple primitivesT)))]) (module.with-module +0 module-name))]] diff --git a/stdlib/test/test/lux/language/compiler/analysis/function.lux b/stdlib/test/test/lux/language/compiler/analysis/function.lux index 32ef59e3f..f3d8ce0dc 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/function.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/function.lux @@ -44,7 +44,7 @@ (n/= num-args (list.size argsA))) (#e.Error error) - false))) + #0))) (context: "Function definition." (<| (times +100) diff --git a/stdlib/test/test/lux/language/compiler/analysis/primitive.lux b/stdlib/test/test/lux/language/compiler/analysis/primitive.lux index fadde9bb0..07510ae9d 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/primitive.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/primitive.lux @@ -69,7 +69,7 @@ (is? [] output) _ - false))) + #0))) (<| (times +100) (`` ($_ seq (~~ (do-template [<desc> <type> <tag> <random> <constructor>] @@ -81,7 +81,7 @@ (is? sample output) _ - false))))] + #0))))] ["bit" Bit #analysis.Bit r.bit code.bit] ["nat" Nat #analysis.Nat r.nat code.nat] diff --git a/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux b/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux index 7ea4a23bd..19d1e8e96 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux @@ -41,8 +41,8 @@ (#e.Error error) <failure>)))] - [check-success+ true false] - [check-failure+ false true] + [check-success+ #1 #0] + [check-failure+ #0 #1] ) (context: "Lux procedures" @@ -185,10 +185,10 @@ (_primitive.analyse code)))) (compiler.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) - true + #1 (#e.Error error) - false)))]] + #0)))]] ($_ seq (test "Can create arrays." (check-success+ "lux array new" (list sizeC) arrayT)) @@ -255,10 +255,10 @@ (_primitive.analyse (` ("lux atom read" (~ (code.symbol ["" var-name])))))))) (compiler.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) - true + #1 (#e.Error _) - false))) + #0))) (test "Can swap the value of an atomic reference." (|> (scope.with-scope "" (scope.with-local [var-name atomT] @@ -269,10 +269,10 @@ (~ elemC))))))) (compiler.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) - true + #1 (#e.Error _) - false))) + #0))) )))) (context: "Process procedures" diff --git a/stdlib/test/test/lux/language/compiler/analysis/reference.lux b/stdlib/test/test/lux/language/compiler/analysis/reference.lux index d68e2e8f4..0ae6dbe96 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/reference.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/reference.lux @@ -42,8 +42,8 @@ (#e.Error _) <on-failure>)))] - [success? true false] - [failure? false true] + [success? #1 #0] + [failure? #0 #1] ) (def: (reach-test var-name [export? def-module] [import? dependent-module] check!) @@ -52,7 +52,7 @@ [_ (module.with-module +0 def-module (module.define var-name [Any (if export? - (' {#.export? true}) + (' {#.export? #1}) (' {})) []]))] (module.with-module +0 dependent-module @@ -86,7 +86,7 @@ (n/= +0 var)) _ - false))) + #0))) (test "Can analyse definition (in the same module)." (let [def-name [def-module var-name]] (|> (do compiler.Monad<Operation> @@ -100,11 +100,11 @@ (ident/= def-name constant-name)) _ - false)))) + #0)))) (test "Can analyse definition (if exported from imported module)." - (reach-test var-name [true def-module] [true dependent-module] success?)) + (reach-test var-name [#1 def-module] [#1 dependent-module] success?)) (test "Cannot analyse definition (if not exported from imported module)." - (reach-test var-name [false def-module] [true dependent-module] failure?)) + (reach-test var-name [#0 def-module] [#1 dependent-module] failure?)) (test "Cannot analyse definition (if exported from non-imported module)." - (reach-test var-name [true def-module] [false dependent-module] failure?)) + (reach-test var-name [#1 def-module] [#0 dependent-module] failure?)) )))) diff --git a/stdlib/test/test/lux/language/compiler/analysis/structure.lux b/stdlib/test/test/lux/language/compiler/analysis/structure.lux index 8d8ce4cd0..3fb2d2455 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/structure.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/structure.lux @@ -44,8 +44,8 @@ _ <on-error>)))] - [check-succeeds true false] - [check-fails false true] + [check-succeeds #1 #0] + [check-fails #0 #1] ) (def: (check-sum' size tag variant) @@ -68,12 +68,12 @@ (check-sum' size tag variant) _ - false))) + #0))) (def: (tagged module tags type) (All [a] (-> Text (List module.Tag) Type (Operation a) (Operation [Module a]))) (|>> (do compiler.Monad<Operation> - [_ (module.declare-tags tags false type)]) + [_ (module.declare-tags tags #0 type)]) (module.with-module +0 module))) (def: (check-variant module tags type size tag analysis) @@ -88,7 +88,7 @@ (check-sum' size tag variant) _ - false))) + #0))) (def: (right-size? size) (-> Nat (-> Analysis Bit)) @@ -104,7 +104,7 @@ (right-size? size productA)) _ - false))) + #0))) (context: "Sums" (<| (times +100) @@ -140,7 +140,7 @@ (check-sum' size choice variant) _ - false))) + #0))) (test "Cannot analyse sum through unbound type-vars." (|> (do compiler.Monad<Operation> [[_ varT] (typeA.with-env check.var)] @@ -182,7 +182,7 @@ (right-size? size tupleA) _ - false))) + #0))) (test "Can infer product." (|> (typeA.with-inference (/.product ..analyse (list/map product.right primitives))) @@ -192,7 +192,7 @@ (right-size? size tupleA)) _ - false))) + #0))) (test "Can analyse pseudo-product (singleton tuple)" (|> (typeA.with-type singletonT (..analyse (` [(~ singletonC)]))) @@ -209,7 +209,7 @@ (right-size? size tupleA) _ - false))) + #0))) (test "Can analyse product through existential quantification." (|> (typeA.with-type (type.ex-q +1 +tupleT) (/.product ..analyse (list/map product.right +primitives))) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/case.lux b/stdlib/test/test/lux/language/compiler/synthesis/case.lux index ff84207a1..0f907f310 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/case.lux +++ b/stdlib/test/test/lux/language/compiler/synthesis/case.lux @@ -32,7 +32,7 @@ (expressionS.synthesizer extensionL.empty) (///compiler.run //.init) (error/map (//primitive.corresponds? maskedA)) - (error.default false)))))) + (error.default #0)))))) (context: "Let expressions." (<| (times +100) @@ -55,7 +55,7 @@ (//primitive.corresponds? outputA outputS)) _ - false)))))) + #0)))))) (context: "If expressions." (<| (times +100) @@ -65,10 +65,10 @@ thenA //primitive.primitive elseA //primitive.primitive #let [thenB (: Branch - [(#analysisL.Simple (#analysisL.Bit true)) + [(#analysisL.Simple (#analysisL.Bit #1)) thenA]) elseB (: Branch - [(#analysisL.Simple (#analysisL.Bit false)) + [(#analysisL.Simple (#analysisL.Bit #0)) elseA]) ifA (if then|else (analysisL.control/case [inputA [thenB (list elseB)]]) @@ -83,4 +83,4 @@ (//primitive.corresponds? elseA elseS)) _ - false)))))) + #0)))))) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/function.lux b/stdlib/test/test/lux/language/compiler/synthesis/function.lux index 0116033bd..0c55b64fd 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/function.lux +++ b/stdlib/test/test/lux/language/compiler/synthesis/function.lux @@ -88,7 +88,7 @@ (def: local-function (r.Random [Arity Analysis Variable]) (loop [arity +0 - nest? true] + nest? #1] (if nest? (do r.Monad<Random> [nest?' r.bit @@ -129,7 +129,7 @@ (variable/= prediction//environment output)) _ - false))) + #0))) (test "Folded functions properly offset local variables." (|> function//local (expressionS.synthesizer extensionL.empty) @@ -139,7 +139,7 @@ (variable/= prediction//local output)) _ - false))) + #0))) )))) (context: "Function application." @@ -159,7 +159,7 @@ (list.zip2 argsA argsS))) _ - false))) + #0))) (test "Function application on no arguments just synthesizes to the function itself." (|> (analysisL.apply [funcA (list)]) (expressionS.synthesizer extensionL.empty) @@ -168,5 +168,5 @@ (//primitive.corresponds? funcA funcS) _ - false))) + #0))) )))) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux b/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux index c804b94ff..0bf5d9765 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux +++ b/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux @@ -64,7 +64,7 @@ (is? valueS valueA) _ - false)) + #0)) (context: "Primitives." (<| (times +100) @@ -85,7 +85,7 @@ (is? <sample> value) _ - false)))] + #0)))] ["unit" #analysisL.Unit #//.Text //.unit] ["bit" #analysisL.Bit #//.Bit %bit%] diff --git a/stdlib/test/test/lux/language/compiler/synthesis/structure.lux b/stdlib/test/test/lux/language/compiler/synthesis/structure.lux index db56757d1..d3845929c 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/structure.lux +++ b/stdlib/test/test/lux/language/compiler/synthesis/structure.lux @@ -39,7 +39,7 @@ (//primitive.corresponds? memberA valueS))) _ - false))) + #0))) )))) (context: "Tuples" @@ -58,5 +58,5 @@ (list.zip2 membersA membersS))) _ - false))) + #0))) )))) diff --git a/stdlib/test/test/lux/language/syntax.lux b/stdlib/test/test/lux/language/syntax.lux index 8c93867aa..110140e58 100644 --- a/stdlib/test/test/lux/language/syntax.lux +++ b/stdlib/test/test/lux/language/syntax.lux @@ -89,7 +89,7 @@ (case (&.read "" (dict.new text.Hash<Text>) [default-cursor +0 (code.to-text sample)]) (#e.Error error) - false + #0 (#e.Success [_ parsed]) (:: code.Equivalence<Code> = parsed sample))) @@ -98,13 +98,13 @@ [default-cursor +0 (format (code.to-text sample) " " (code.to-text other))]) (#e.Error error) - false + #0 (#e.Success [remaining =sample]) (case (&.read "" (dict.new text.Hash<Text>) remaining) (#e.Error error) - false + #0 (#e.Success [_ =other]) (and (:: code.Equivalence<Code> = sample =sample) @@ -129,7 +129,7 @@ (f/= expected actual) _ - false) + #0) )))) (context: "Nat special syntax." @@ -144,7 +144,7 @@ (n/= expected actual) _ - false) + #0) )))) (def: comment-text^ @@ -193,10 +193,10 @@ [default-cursor +0 (format "\"" bad-match "\"")]) (#e.Error error) - true + #1 (#e.Success [_ parsed]) - false))) + #0))) (test "Will accept valid multi-line text" (let [good-input (format (text.from-code x) "\n" offset (text.from-code y) "\n" @@ -209,7 +209,7 @@ +0 (format "\"" good-input "\"")]) (#e.Error error) - false + #0 (#e.Success [_ parsed]) (:: code.Equivalence<Code> = @@ -220,7 +220,7 @@ [default-cursor +0 (format comment (code.to-text sample))]) (#e.Error error) - false + #0 (#e.Success [_ parsed]) (:: code.Equivalence<Code> = parsed sample))) @@ -230,17 +230,17 @@ (format "#(" "#(" unbalanced-comment ")#" (code.to-text sample))]) (#e.Error error) - true + #1 (#e.Success [_ parsed]) - false) + #0) (case (&.read "" (dict.new text.Hash<Text>) [default-cursor +0 (format "#(" unbalanced-comment ")#" ")#" (code.to-text sample))]) (#e.Error error) - true + #1 (#e.Success [_ parsed]) - false))) + #0))) )))) diff --git a/stdlib/test/test/lux/language/type.lux b/stdlib/test/test/lux/language/type.lux index 5f2cff09b..631e3de09 100644 --- a/stdlib/test/test/lux/language/type.lux +++ b/stdlib/test/test/lux/language/type.lux @@ -55,13 +55,13 @@ (context: "Type application" (test "Can apply quantified types (universal and existential quantification)." - (and (maybe.default false + (and (maybe.default #0 (do maybe.Monad<Maybe> [partial (&.apply (list Bit) Ann) full (&.apply (list Int) partial)] (wrap (:: &.Equivalence<Type> = full (#.Product Bit Int))))) (|> (&.apply (list Bit) Text) - (case> #.None true _ false))))) + (case> #.None #1 _ #0))))) (context: "Naming" (let [base (#.Named ["" "a"] (#.Product Bit Int)) @@ -90,10 +90,10 @@ (r.filter (function (_ type) (case type (^or (#.Sum _) (#.Product _)) - false + #0 _ - true))) + #1))) (list.repeat size) (M.seq @)) #let [(^open "&/") &.Equivalence<Type> @@ -122,10 +122,10 @@ (r.filter (function (_ type) (case type (^or (#.Function _) (#.Apply _)) - false + #0 _ - true)))) + #1)))) #let [(^open "&/") &.Equivalence<Type> (^open "L/") (list.Equivalence<List> &.Equivalence<Type>)]] ($_ seq @@ -147,10 +147,10 @@ (r.filter (function (_ type) (case type (^or (#.UnivQ _) (#.ExQ _)) - false + #0 _ - true)))) + #1)))) #let [(^open "&/") &.Equivalence<Type>]] (with-expansions [<quant-tests> (do-template [<desc> <ctor> <dtor>] diff --git a/stdlib/test/test/lux/language/type/check.lux b/stdlib/test/test/lux/language/type/check.lux index c2db4533c..1faf59f16 100644 --- a/stdlib/test/test/lux/language/type/check.lux +++ b/stdlib/test/test/lux/language/type/check.lux @@ -56,7 +56,7 @@ (list.every? valid-type? params) (#.Ex id) - true + #1 (^template [<tag>] (<tag> left right) @@ -67,16 +67,16 @@ (valid-type? type') _ - false)) + #0)) (def: (type-checks? input) (-> (@.Check []) Bit) (case (@.run @.fresh-context input) (#.Right []) - true + #1 (#.Left error) - false)) + #0)) ## [Tests] (context: "Any and Nothing." @@ -210,7 +210,7 @@ (<| (times +100) (do @ [num-connections (|> r.nat (:: @ map (n/% +100))) - boundT (|> gen-type (r.filter (|>> (case> (#.Var _) false _ true)))) + boundT (|> gen-type (r.filter (|>> (case> (#.Var _) #0 _ #1)))) pick-pcg (r.seq r.nat r.nat)] ($_ seq (test "Can create rings of variables." diff --git a/stdlib/test/test/lux/macro/code.lux b/stdlib/test/test/lux/macro/code.lux index 0dfcd8fa0..1a7eba2b7 100644 --- a/stdlib/test/test/lux/macro/code.lux +++ b/stdlib/test/test/lux/macro/code.lux @@ -18,17 +18,17 @@ (and (text/= <text> (&.to-text <expr>)) (:: &.Equivalence<Code> = <expr> <expr>)))] - [(&.bit true) "true"] - [(&.bit false) "false"] - [(&.int 123) "123"] - [(&.frac 123.0) "123.0"] - [(&.text "\n") "\"\\n\""] - [(&.tag ["yolo" "lol"]) "#yolo.lol"] - [(&.symbol ["yolo" "lol"]) "yolo.lol"] - [(&.form (list (&.bit true) (&.int 123))) "(true 123)"] - [(&.tuple (list (&.bit true) (&.int 123))) "[true 123]"] - [(&.record (list [(&.bit true) (&.int 123)])) "{true 123}"] - [(&.local-tag "lol") "#lol"] - [(&.local-symbol "lol") "lol"] + [(&.bit #1) "#1"] + [(&.bit #0) "#0"] + [(&.int 123) "123"] + [(&.frac 123.0) "123.0"] + [(&.text "\n") "\"\\n\""] + [(&.tag ["yolo" "lol"]) "#yolo.lol"] + [(&.symbol ["yolo" "lol"]) "yolo.lol"] + [(&.form (list (&.bit #1) (&.int 123))) "(#1 123)"] + [(&.tuple (list (&.bit #1) (&.int 123))) "[#1 123]"] + [(&.record (list [(&.bit #1) (&.int 123)])) "{#1 123}"] + [(&.local-tag "lol") "#lol"] + [(&.local-symbol "lol") "lol"] )] ($_ seq <tests>))) diff --git a/stdlib/test/test/lux/macro/poly/functor.lux b/stdlib/test/test/lux/macro/poly/functor.lux index 6d335701e..3bd4a0847 100644 --- a/stdlib/test/test/lux/macro/poly/functor.lux +++ b/stdlib/test/test/lux/macro/poly/functor.lux @@ -21,4 +21,4 @@ ## [Tests] (context: "Functor polytypism." (test "Can derive functors automatically." - true)) + #1)) diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index 35e25734f..c30157eb7 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -24,19 +24,19 @@ (-> (Syntax []) (List Code) Bit) (case (p.run input parser) (#.Right [_ []]) - true + #1 _ - false)) + #0)) (def: (found? parser input) (-> (Syntax Bit) (List Code) Bit) (case (p.run input parser) - (#.Right [_ true]) - true + (#.Right [_ #1]) + #1 _ - false)) + #0)) (def: (equals? Equivalence<a> reference parser input) (All [a] (-> (Equivalence a) a (Syntax a) (List Code) Bit)) @@ -45,24 +45,24 @@ (:: Equivalence<a> = reference output) _ - false)) + #0)) (def: (fails? input) (All [a] (-> (e.Error a) Bit)) (case input (#.Left _) - true + #1 _ - false)) + #0)) (syntax: (match pattern input) (wrap (list (` (case (~ input) (^ (#.Right [(~' _) (~ pattern)])) - true + #1 (~' _) - false))))) + #0))))) ## [Tests] (context: "Simple value syntax." @@ -73,7 +73,7 @@ (found? (s.this? (<ctor> <value>)) (list (<ctor> <value>))) (enforced? (s.this (<ctor> <value>)) (list (<ctor> <value>)))))] - ["Can parse Bit syntax." true code.bit bit.Equivalence<Bit> s.bit] + ["Can parse Bit syntax." #1 code.bit bit.Equivalence<Bit> s.bit] ["Can parse Nat syntax." +123 code.nat number.Equivalence<Nat> s.nat] ["Can parse Int syntax." 123 code.int number.Equivalence<Int> s.int] ["Can parse Rev syntax." .123 code.rev number.Equivalence<Rev> s.rev] @@ -104,16 +104,16 @@ (with-expansions [<group-tests> (do-template [<type> <parser> <ctor>] [(test (format "Can parse " <type> " syntax.") - (and (match [true 123] - (p.run (list (<ctor> (list (code.bit true) (code.int 123)))) + (and (match [#1 123] + (p.run (list (<ctor> (list (code.bit #1) (code.int 123)))) (<parser> (p.seq s.bit s.int)))) - (match true - (p.run (list (<ctor> (list (code.bit true)))) + (match #1 + (p.run (list (<ctor> (list (code.bit #1)))) (<parser> s.bit))) - (fails? (p.run (list (<ctor> (list (code.bit true) (code.int 123)))) + (fails? (p.run (list (<ctor> (list (code.bit #1) (code.int 123)))) (<parser> s.bit))) - (match (#.Left true) - (p.run (list (<ctor> (list (code.bit true)))) + (match (#.Left #1) + (p.run (list (<ctor> (list (code.bit #1)))) (<parser> (p.alt s.bit s.int)))) (match (#.Right 123) (p.run (list (<ctor> (list (code.int 123)))) @@ -127,30 +127,30 @@ <group-tests> (test "Can parse record syntax." - (match [true 123] - (p.run (list (code.record (list [(code.bit true) (code.int 123)]))) + (match [#1 123] + (p.run (list (code.record (list [(code.bit #1) (code.int 123)]))) (s.record (p.seq s.bit s.int))))) ))) (context: "Combinators" ($_ seq (test "Can parse any Code." - (match [_ (#.Bit true)] - (p.run (list (code.bit true) (code.int 123)) + (match [_ (#.Bit #1)] + (p.run (list (code.bit #1) (code.int 123)) s.any))) (test "Can check whether the end has been reached." - (and (match true + (and (match #1 (p.run (list) s.end?)) - (match false - (p.run (list (code.bit true)) + (match #0 + (p.run (list (code.bit #1)) s.end?)))) (test "Can ensure the end has been reached." (and (match [] (p.run (list) s.end!)) - (fails? (p.run (list (code.bit true)) + (fails? (p.run (list (code.bit #1)) s.end!)))) )) diff --git a/stdlib/test/test/lux/math/logic/continuous.lux b/stdlib/test/test/lux/math/logic/continuous.lux index 4dc768cc2..a5501b737 100644 --- a/stdlib/test/test/lux/math/logic/continuous.lux +++ b/stdlib/test/test/lux/math/logic/continuous.lux @@ -16,21 +16,21 @@ right r.rev] ($_ seq (test "AND is the minimum." - (let [result (&.~and left right)] + (let [result (&.and left right)] (and (r/<= left result) (r/<= right result)))) (test "OR is the maximum." - (let [result (&.~or left right)] + (let [result (&.or left right)] (and (r/>= left result) (r/>= right result)))) (test "Double negation results in the original value." - (r/= left (&.~not (&.~not left)))) + (r/= left (&.not (&.not left)))) (test "Every value is equivalent to itself." (and (r/>= left - (&.~= left left)) + (&.= left left)) (r/>= right - (&.~= right right)))) + (&.= right right)))) )))) diff --git a/stdlib/test/test/lux/math/logic/fuzzy.lux b/stdlib/test/test/lux/math/logic/fuzzy.lux index 104c0cf76..55f5d0c67 100644 --- a/stdlib/test/test/lux/math/logic/fuzzy.lux +++ b/stdlib/test/test/lux/math/logic/fuzzy.lux @@ -15,7 +15,7 @@ ["r" random] [logic ["&" fuzzy] - continuous]]] + ["_" continuous]]]] lux/test) (do-template [<desc> <hash> <gen> <triangle> <lt> <lte> <gt> <gte>] @@ -39,19 +39,19 @@ triangle (<triangle> x y z)]] ($_ seq (test "The middle value will always have maximum membership." - (r/= ~true (&.membership middle triangle))) + (r/= _.true (&.membership middle triangle))) (test "Boundary values will always have 0 membership." - (and (r/= ~false (&.membership bottom triangle)) - (r/= ~false (&.membership top triangle)))) + (and (r/= _.false (&.membership bottom triangle)) + (r/= _.false (&.membership top triangle)))) (test "Values within range, will have membership > 0." - (bit/= (r/> ~false (&.membership sample triangle)) + (bit/= (r/> _.false (&.membership sample triangle)) (and (<gt> bottom sample) (<lt> top sample)))) (test "Values outside of range, will have membership = 0." - (bit/= (r/= ~false (&.membership sample triangle)) + (bit/= (r/= _.false (&.membership sample triangle)) (or (<lte> bottom sample) (<gte> top sample)))) ))))] @@ -80,25 +80,25 @@ trapezoid (<trapezoid> w x y z)]] ($_ seq (test "The middle values will always have maximum membership." - (and (r/= ~true (&.membership middle-bottom trapezoid)) - (r/= ~true (&.membership middle-top trapezoid)))) + (and (r/= _.true (&.membership middle-bottom trapezoid)) + (r/= _.true (&.membership middle-top trapezoid)))) (test "Boundary values will always have 0 membership." - (and (r/= ~false (&.membership bottom trapezoid)) - (r/= ~false (&.membership top trapezoid)))) + (and (r/= _.false (&.membership bottom trapezoid)) + (r/= _.false (&.membership top trapezoid)))) (test "Values within inner range will have membership = 1" - (bit/= (r/= ~true (&.membership sample trapezoid)) + (bit/= (r/= _.true (&.membership sample trapezoid)) (and (<gte> middle-bottom sample) (<lte> middle-top sample)))) (test "Values within range, will have membership > 0." - (bit/= (r/> ~false (&.membership sample trapezoid)) + (bit/= (r/> _.false (&.membership sample trapezoid)) (and (<gt> bottom sample) (<lt> top sample)))) (test "Values outside of range, will have membership = 0." - (bit/= (r/= ~false (&.membership sample trapezoid)) + (bit/= (r/= _.false (&.membership sample trapezoid)) (or (<lte> bottom sample) (<gte> top sample)))) ))))] @@ -139,7 +139,7 @@ (test "Complement membership is the opposite of normal membership." (r/= (&.membership sample left) - (~not (&.membership sample (&.complement left))))) + (_.not (&.membership sample (&.complement left))))) (test "Membership in the difference will never be higher than in the set being subtracted." (bit/= (r/> (&.membership sample right) @@ -156,12 +156,12 @@ ($_ seq (test "Values that satisfy a predicate have membership = 1. Values that don't have membership = 0." - (bit/= (r/= ~true (&.membership sample (&.from-predicate n/even?))) + (bit/= (r/= _.true (&.membership sample (&.from-predicate n/even?))) (n/even? sample))) (test "Values that belong to a set have membership = 1. Values that don't have membership = 0." - (bit/= (r/= ~true (&.membership sample (&.from-set set-10))) + (bit/= (r/= _.true (&.membership sample (&.from-set set-10))) (set.member? set-10 sample))) )))) @@ -175,7 +175,7 @@ member? (&.to-predicate threshold fuzzy)]] ($_ seq (test "Can increase the threshold of membership of a fuzzy set." - (bit/= (r/> ~false (&.membership sample vip-fuzzy)) + (bit/= (r/> _.false (&.membership sample vip-fuzzy)) (r/> threshold (&.membership sample fuzzy)))) (test "Can turn fuzzy sets into predicates through a threshold." diff --git a/stdlib/test/test/lux/math/modular.lux b/stdlib/test/test/lux/math/modular.lux index 47b8b8aba..f54c2ef69 100644 --- a/stdlib/test/test/lux/math/modular.lux +++ b/stdlib/test/test/lux/math/modular.lux @@ -112,7 +112,7 @@ (/.m/= (/.mod normalM 1))) #.None - true)) + #1)) (test "Can encode/decode to text." (let [(^open "mod/") (/.Codec<Text,Mod> normalM)] @@ -121,7 +121,7 @@ (/.m/= subject output) (#e.Error error) - false))) + #0))) (test "Can equalize 2 moduli if they are equal." (case (/.equalize (/.mod normalM _subject) @@ -130,16 +130,16 @@ (/.m/= param paramC) (#e.Error error) - false)) + #0)) (test "Cannot equalize 2 moduli if they are the different." (case (/.equalize (/.mod normalM _subject) (/.mod alternativeM _param)) (#e.Success paramA) - false + #0 (#e.Error error) - true)) + #1)) (test "All numbers are congruent to themselves." (/.congruent? normalM _subject _subject)) diff --git a/stdlib/test/test/lux/time/date.lux b/stdlib/test/test/lux/time/date.lux index 9f70e738f..5e92fffce 100644 --- a/stdlib/test/test/lux/time/date.lux +++ b/stdlib/test/test/lux/time/date.lux @@ -144,4 +144,4 @@ (@/= sample decoded) (#error.Error error) - false)))))) + #0)))))) diff --git a/stdlib/test/test/lux/time/duration.lux b/stdlib/test/test/lux/time/duration.lux index c5896b193..f746f9217 100644 --- a/stdlib/test/test/lux/time/duration.lux +++ b/stdlib/test/test/lux/time/duration.lux @@ -80,7 +80,7 @@ #let [(^open "@/") @.Equivalence<Duration> (^open "@/") @.Codec<Text,Duration>]] (test "Can encode/decode durations." - (E.default false + (E.default #0 (do E.Monad<Error> [decoded (|> sample @/encode @/decode)] (wrap (@/= sample decoded)))))))) diff --git a/stdlib/test/test/lux/time/instant.lux b/stdlib/test/test/lux/time/instant.lux index 6914bd7b0..27161fa67 100644 --- a/stdlib/test/test/lux/time/instant.lux +++ b/stdlib/test/test/lux/time/instant.lux @@ -96,4 +96,4 @@ ## (@/= sample decoded) ## (#error.Error error) -## false)))))) +## #0)))))) diff --git a/stdlib/test/test/lux/type/object/protocol.lux b/stdlib/test/test/lux/type/object/protocol.lux index 2e2ae212f..fe463205d 100644 --- a/stdlib/test/test/lux/type/object/protocol.lux +++ b/stdlib/test/test/lux/type/object/protocol.lux @@ -46,7 +46,7 @@ (def: _test1 [Nat Object0] - (object0 (method1 [+0 "0" false]))) + (object0 (method1 [+0 "0" #0]))) (protocol: (Read a) (read [] a)) diff --git a/stdlib/test/test/lux/world/blob.lux b/stdlib/test/test/lux/world/blob.lux index ea9dc4087..24035bb0d 100644 --- a/stdlib/test/test/lux/world/blob.lux +++ b/stdlib/test/test/lux/world/blob.lux @@ -23,7 +23,7 @@ (-> (e.Error Bit) Bit) (case result (#e.Error _) - false + #0 (#e.Success output) output)) @@ -85,5 +85,5 @@ (:: (list.Equivalence<List> number.Equivalence<Nat>) = slice-vals blob-vals) _ - false)))) + #0)))) )))) diff --git a/stdlib/test/test/lux/world/file.lux b/stdlib/test/test/lux/world/file.lux index 6f508baaa..43b62ac3f 100644 --- a/stdlib/test/test/lux/world/file.lux +++ b/stdlib/test/test/lux/world/file.lux @@ -48,7 +48,7 @@ (wrap (and (not pre!) post! (not remains?)))))] (assert "Can create/delete files." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [file (format "temp_file_" (%n (n/+ +1 code)))] result (promise.future @@ -58,7 +58,7 @@ _ (:: @.JVM@System delete file)] (wrap (:: blob.Equivalence<Blob> = dataL output))))] (assert "Can write/read files." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [file (format "temp_file_" (%n (n/+ +2 code)))] result (promise.future @@ -68,7 +68,7 @@ _ (:: @.JVM@System delete file)] (wrap (n/= file-size read-size))))] (assert "Can read file size." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [file (format "temp_file_" (%n (n/+ +3 code)))] result (promise.future @@ -82,7 +82,7 @@ (:: blob.Equivalence<Blob> = dataL (error.assume (blob.slice +0 (dec file-size) output))) (:: blob.Equivalence<Blob> = dataR (error.assume (blob.slice file-size (dec read-size) output)))))))] (assert "Can append to files." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [dir (format "temp_dir_" (%n (n/+ +4 code)))] result (promise.future @@ -95,7 +95,7 @@ (wrap (and (not pre!) post! (not remains?)))))] (assert "Can create/delete directories." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [file (format "temp_file_" (%n (n/+ +5 code))) dir (format "temp_dir_" (%n (n/+ +5 code)))] @@ -112,7 +112,7 @@ (wrap (and file-is-file (not file-is-directory) (not directory-is-file) directory-is-directory))))] (assert "Can differentiate files from directories." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [file (format "temp_file_" (%n (n/+ +6 code))) dir (format "temp_dir_" (%n (n/+ +6 code)))] @@ -126,7 +126,7 @@ _ (:: @.JVM@System delete dir)] (wrap (n/= file-size read-size))))] (assert "Can create files inside of directories." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [file (format "temp_file_" (%n (n/+ +7 code))) dir (format "temp_dir_" (%n (n/+ +7 code)))] @@ -143,9 +143,9 @@ (text.ends-with? file' child) _ - false))))] + #0))))] (assert "Can list files inside a directory." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [file (format "temp_file_" (%n (n/+ +8 code)))] result (promise.future @@ -156,7 +156,7 @@ _ (:: @.JVM@System delete file)] (wrap (:: instant.Equivalence<Instant> = last-modified time-read))))] (assert "Can change the time of last modification." - (error.default false result)))) + (error.default #0 result)))) (wrap (do promise.Monad<Promise> [#let [file0 (format "temp_file_" (%n (n/+ +9 code)) "0") file1 (format "temp_file_" (%n (n/+ +9 code)) "1")] @@ -170,5 +170,5 @@ _ (:: @.JVM@System delete file1)] (wrap (and pre! (not post!) confirmed?))))] (assert "Can move a file from one path to another." - (error.default false result)))) + (error.default #0 result)))) ))) diff --git a/stdlib/test/test/lux/world/net/tcp.lux b/stdlib/test/test/lux/world/net/tcp.lux index 1c315c7f5..b72364e5b 100644 --- a/stdlib/test/test/lux/world/net/tcp.lux +++ b/stdlib/test/test/lux/world/net/tcp.lux @@ -66,5 +66,5 @@ (wrap (and from-worked? to-worked?)))] (assert "Can communicate between client and server." - (E.default false result)))) + (E.default #0 result)))) ))) diff --git a/stdlib/test/test/lux/world/net/udp.lux b/stdlib/test/test/lux/world/net/udp.lux index b1685ebc7..a00b75dbf 100644 --- a/stdlib/test/test/lux/world/net/udp.lux +++ b/stdlib/test/test/lux/world/net/udp.lux @@ -59,5 +59,5 @@ (wrap (and from-worked? to-worked?)))] (assert "Can communicate between client and server." - (E.default false result)))) + (E.default #0 result)))) ))) |