aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/cli.lux32
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/analysis/function.lux6
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux16
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux6
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/analysis/reference.lux12
-rw-r--r--stdlib/test/test/lux/compiler/default/syntax.lux28
-rw-r--r--stdlib/test/test/lux/control/concurrency/actor.lux6
-rw-r--r--stdlib/test/test/lux/control/exception.lux4
-rw-r--r--stdlib/test/test/lux/control/parser.lux9
-rw-r--r--stdlib/test/test/lux/control/region.lux13
-rw-r--r--stdlib/test/test/lux/control/security/taint.lux4
-rw-r--r--stdlib/test/test/lux/data/error.lux51
-rw-r--r--stdlib/test/test/lux/data/format/json.lux6
-rw-r--r--stdlib/test/test/lux/data/text/lexer.lux10
-rw-r--r--stdlib/test/test/lux/macro/syntax.lux16
-rw-r--r--stdlib/test/test/lux/math/modular.lux20
-rw-r--r--stdlib/test/test/lux/time/date.lux2
-rw-r--r--stdlib/test/test/lux/time/instant.lux2
-rw-r--r--stdlib/test/test/lux/world/binary.lux22
19 files changed, 143 insertions, 122 deletions
diff --git a/stdlib/test/test/lux/cli.lux b/stdlib/test/test/lux/cli.lux
index 501c62df4..12e0b7361 100644
--- a/stdlib/test/test/lux/cli.lux
+++ b/stdlib/test/test/lux/cli.lux
@@ -5,7 +5,7 @@
pipe
["p" parser]]
[data
- ["E" error]
+ ["." error]
["." number]
[text ("text/." Equivalence<Text>)
format]
@@ -30,32 +30,44 @@
($_ seq
(test "Can read any argument."
(|> (/.run (list yes) /.any)
- (case> (#E.Error _)
+ (case> (#error.Failure _)
#0
- (#E.Success arg)
+ (#error.Success arg)
(text/= arg yes))))
(test "Can test tokens."
(and (|> (/.run (list yes) (/.this yes))
- (case> (#E.Error _) #0 (#E.Success _) #1))
+ (case> (#error.Failure _)
+ #0
+
+ (#error.Success _)
+ #1))
(|> (/.run (list no) (/.this yes))
- (case> (#E.Error _) #1 (#E.Success _) #0))))
+ (case> (#error.Failure _)
+ #1
+
+ (#error.Success _)
+ #0))))
(test "Can use custom token parsers."
(|> (/.run (list yes) (/.parse Nat/decode))
- (case> (#E.Error _)
+ (case> (#error.Failure _)
#0
- (#E.Success parsed)
+ (#error.Success parsed)
(text/= (Nat/encode parsed)
yes))))
(test "Can query if there are any more inputs."
(and (|> (/.run (list) /.end)
- (case> (#E.Success []) #1 _ #0))
+ (case> (#error.Success []) #1 _ #0))
(|> (/.run (list yes) (p.not /.end))
- (case> (#E.Success []) #0 _ #1))))
+ (case> (#error.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 _) #0 (#E.Success _) #1)))
+ (case> (#error.Failure _)
+ #0
+
+ (#error.Success _)
+ #1)))
))))
diff --git a/stdlib/test/test/lux/compiler/default/phase/analysis/function.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/function.lux
index e9d1c6f8e..e46f22585 100644
--- a/stdlib/test/test/lux/compiler/default/phase/analysis/function.lux
+++ b/stdlib/test/test/lux/compiler/default/phase/analysis/function.lux
@@ -4,7 +4,7 @@
[monad (#+ do)]
pipe]
[data
- ["e" error]
+ ["." error]
["." maybe]
["." product]
[text ("text/." Equivalence<Text>)
@@ -37,11 +37,11 @@
(|> analysis
(typeA.with-type expectedT)
(phase.run _primitive.state)
- (case> (#e.Success applyA)
+ (case> (#error.Success applyA)
(let [[funcA argsA] (analysis.application applyA)]
(n/= num-args (list.size argsA)))
- (#e.Error error)
+ (#error.Failure error)
#0)))
(context: "Function definition."
diff --git a/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux
index 6a64cc206..a101c5414 100644
--- a/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux
+++ b/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux
@@ -5,7 +5,7 @@
pipe
["ex" exception (#+ exception:)]]
[data
- ["e" error]
+ ["." error (#+ Error)]
[text
format]]
[math
@@ -57,23 +57,23 @@
["Inferred" (%type inferred)]))
(def: (infer-primitive expected-type analysis)
- (-> Type (Operation Analysis) (e.Error Analysis))
+ (-> Type (Operation Analysis) (Error Analysis))
(|> analysis
typeA.with-inference
(phase.run ..state)
- (case> (#e.Success [inferred-type output])
+ (case> (#error.Success [inferred-type output])
(if (is? expected-type inferred-type)
- (#e.Success output)
+ (#error.Success output)
(ex.throw wrong-inference [expected-type inferred-type]))
- (#e.Error error)
- (#e.Error error))))
+ (#error.Failure error)
+ (#error.Failure error))))
(context: "Primitives"
($_ seq
(test "Can analyse unit."
(|> (infer-primitive Any (..phase (' [])))
- (case> (^ (#e.Success (#analysis.Primitive (#analysis.Unit output))))
+ (case> (^ (#error.Success (#analysis.Primitive (#analysis.Unit output))))
(is? [] output)
_
@@ -85,7 +85,7 @@
[sample <random>]
(test (format "Can analyse " <desc> ".")
(|> (infer-primitive <type> (..phase (<constructor> sample)))
- (case> (#e.Success (#analysis.Primitive (<tag> output)))
+ (case> (#error.Success (#analysis.Primitive (<tag> output)))
(is? sample output)
_
diff --git a/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux
index 108b350d0..2a1a20005 100644
--- a/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux
+++ b/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux
@@ -7,7 +7,7 @@
[concurrency
["." atom]]
[data
- ["e" error]
+ ["." error]
["." product]
[text
format]]
@@ -36,10 +36,10 @@
(typeA.with-type output-type
(_primitive.phase (` ((~ (code.text procedure)) (~+ params))))))
(phase.run _primitive.state)
- (case> (#e.Success _)
+ (case> (#error.Success _)
<success>
- (#e.Error error)
+ (#error.Failure error)
<failure>)))]
[check-success+ #1 #0]
diff --git a/stdlib/test/test/lux/compiler/default/phase/analysis/reference.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/reference.lux
index 8aed9e39b..b24d74e1e 100644
--- a/stdlib/test/test/lux/compiler/default/phase/analysis/reference.lux
+++ b/stdlib/test/test/lux/compiler/default/phase/analysis/reference.lux
@@ -4,7 +4,7 @@
[monad (#+ do)]
pipe]
[data
- ["e" error]
+ ["." error (#+ Error)]
[name ("name/." Equivalence<Name>)]
[text ("text/." Equivalence<Text>)]]
[math
@@ -28,15 +28,15 @@
[//
["_." primitive]])
-(type: Check (-> (e.Error Any) Bit))
+(type: Check (-> (Error Any) Bit))
(do-template [<name> <on-success> <on-failure>]
[(def: <name>
Check
- (|>> (case> (#e.Success _)
+ (|>> (case> (#error.Success _)
<on-success>
- (#e.Error _)
+ (#error.Failure _)
<on-failure>)))]
[success? #1 #0]
@@ -78,7 +78,7 @@
(typeA.with-inference
(_primitive.phase (code.local-identifier var-name)))))
(phase.run _primitive.state)
- (case> (^ (#e.Success [inferredT (#analysis.Reference (reference.local var))]))
+ (case> (^ (#error.Success [inferredT (#analysis.Reference (reference.local var))]))
(and (type/= expectedT inferredT)
(n/= 0 var))
@@ -92,7 +92,7 @@
(_primitive.phase (code.identifier def-name))))
(module.with-module 0 def-module)
(phase.run _primitive.state)
- (case> (^ (#e.Success [_ inferredT (#analysis.Reference (reference.constant constant-name))]))
+ (case> (^ (#error.Success [_ inferredT (#analysis.Reference (reference.constant constant-name))]))
(and (type/= expectedT inferredT)
(name/= def-name constant-name))
diff --git a/stdlib/test/test/lux/compiler/default/syntax.lux b/stdlib/test/test/lux/compiler/default/syntax.lux
index 165a224e5..74d927975 100644
--- a/stdlib/test/test/lux/compiler/default/syntax.lux
+++ b/stdlib/test/test/lux/compiler/default/syntax.lux
@@ -3,13 +3,13 @@
[control
[monad (#+ do)]]
[data
- ["e" error]
+ ["." error]
["." text
format
["l" lexer]]
[collection
["." list]
- ["dict" dictionary (#+ Dictionary)]]]
+ ["." dictionary (#+ Dictionary)]]]
[math
["r" random ("r/." Monad<Random>)]]
[macro
@@ -88,28 +88,28 @@
($_ seq
(test "Can parse Lux code."
(case (let [source-code (%code sample)]
- (&.parse "" (dict.new text.Hash<Text>) (text.size source-code)
+ (&.parse "" (dictionary.new text.Hash<Text>) (text.size source-code)
[default-cursor 0 source-code]))
- (#e.Error error)
+ (#error.Failure error)
#0
- (#e.Success [_ parsed])
+ (#error.Success [_ parsed])
(:: code.Equivalence<Code> = parsed sample)))
(test "Can parse Lux multiple code nodes."
(let [source-code (format (%code sample) " " (%code other))
source-code//size (text.size source-code)]
- (case (&.parse "" (dict.new text.Hash<Text>) source-code//size
+ (case (&.parse "" (dictionary.new text.Hash<Text>) source-code//size
[default-cursor 0 source-code])
- (#e.Error error)
+ (#error.Failure error)
#0
- (#e.Success [remaining =sample])
- (case (&.parse "" (dict.new text.Hash<Text>) source-code//size
+ (#error.Success [remaining =sample])
+ (case (&.parse "" (dictionary.new text.Hash<Text>) source-code//size
remaining)
- (#e.Error error)
+ (#error.Failure error)
#0
- (#e.Success [_ =other])
+ (#error.Success [_ =other])
(and (:: code.Equivalence<Code> = sample =sample)
(:: code.Equivalence<Code> = other =other))))))
))))
@@ -137,11 +137,11 @@
(test "Can handle comments."
(case (let [source-code (format comment (%code sample))
source-code//size (text.size source-code)]
- (&.parse "" (dict.new text.Hash<Text>) source-code//size
+ (&.parse "" (dictionary.new text.Hash<Text>) source-code//size
[default-cursor 0 source-code]))
- (#e.Error error)
+ (#error.Failure error)
#0
- (#e.Success [_ parsed])
+ (#error.Success [_ parsed])
(:: code.Equivalence<Code> = parsed sample)))
))))
diff --git a/stdlib/test/test/lux/control/concurrency/actor.lux b/stdlib/test/test/lux/control/concurrency/actor.lux
index 90c3d6dd4..59a0f4d76 100644
--- a/stdlib/test/test/lux/control/concurrency/actor.lux
+++ b/stdlib/test/test/lux/control/concurrency/actor.lux
@@ -9,7 +9,7 @@
["T" task]
["&" actor (#+ actor: message:)]]]
[data
- ["e" error]
+ ["." error]
[text
format]]]
lux/test)
@@ -67,9 +67,9 @@
(n/= 3 output-3))))]
(assert "Can send messages to actors."
(case result
- (#e.Success outcome)
+ (#error.Success outcome)
outcome
- (#e.Error error)
+ (#error.Failure error)
#0))))
))
diff --git a/stdlib/test/test/lux/control/exception.lux b/stdlib/test/test/lux/control/exception.lux
index 36555f490..aa6c8bf09 100644
--- a/stdlib/test/test/lux/control/exception.lux
+++ b/stdlib/test/test/lux/control/exception.lux
@@ -4,7 +4,7 @@
["M" monad (#+ do Monad)]
["&" exception (#+ exception:)]]
[data
- ["E" error]
+ ["." error (#+ Error)]
["." text
format]]
[math
@@ -39,7 +39,7 @@
another-val)
otherwise-val)
default-val)
- actual (|> (: (E.Error Nat)
+ actual (|> (: (Error Nat)
(if should-throw?
(&.throw this-ex [])
(&.return default-val)))
diff --git a/stdlib/test/test/lux/control/parser.lux b/stdlib/test/test/lux/control/parser.lux
index 378cbccd4..37b296357 100644
--- a/stdlib/test/test/lux/control/parser.lux
+++ b/stdlib/test/test/lux/control/parser.lux
@@ -17,8 +17,11 @@
(def: (should-fail input)
(All [a] (-> (Error a) Bit))
(case input
- (#error.Error _) #1
- _ #0))
+ (#error.Failure _)
+ #1
+
+ _
+ #0))
(def: (enforced? parser input)
(All [s] (-> (&.Parser s Any) s Bit))
@@ -41,7 +44,7 @@
(def: (fails? input)
(All [a] (-> (Error a) Bit))
(case input
- (#error.Error _)
+ (#error.Failure _)
#1
_
diff --git a/stdlib/test/test/lux/control/region.lux b/stdlib/test/test/lux/control/region.lux
index 8a419bb0a..f639739b4 100644
--- a/stdlib/test/test/lux/control/region.lux
+++ b/stdlib/test/test/lux/control/region.lux
@@ -6,7 +6,7 @@
["." thread (#+ Thread)]
["ex" exception (#+ exception:)]]
[data
- ["e" error (#+ Error)]
+ ["." error (#+ Error)]
[collection
["." list]]]
[math
@@ -19,8 +19,11 @@
[(def: (<name> result)
(All [a] (-> (Error a) Bit))
(case result
- (#e.Success _) <success>
- (#e.Error _) <error>))]
+ (#error.Success _)
+ <success>
+
+ (#error.Failure _)
+ <error>))]
[success? #1 #0]
[error? #0 #1]
@@ -39,7 +42,7 @@
count-clean-up (function (_ value)
(do @
[_ (thread.update inc clean-up-counter)]
- (wrap (#e.Success []))))]
+ (wrap (#error.Success []))))]
outcome (/.run @
(do (/.Monad<Region> @)
[_ (monad.map @ (/.acquire @@ count-clean-up)
@@ -57,7 +60,7 @@
count-clean-up (function (_ value)
(do @
[_ (thread.update inc clean-up-counter)]
- (wrap (#e.Success []))))]
+ (wrap (#error.Success []))))]
outcome (/.run @
(do (/.Monad<Region> @)
[_ (monad.map @ (/.acquire @@ count-clean-up)
diff --git a/stdlib/test/test/lux/control/security/taint.lux b/stdlib/test/test/lux/control/security/taint.lux
index 5b33e7127..81b17d407 100644
--- a/stdlib/test/test/lux/control/security/taint.lux
+++ b/stdlib/test/test/lux/control/security/taint.lux
@@ -24,12 +24,12 @@
(case (@.validate (function (_ value)
(if (|> value text.size (n/> 0))
(#error.Success value)
- (#error.Error "Empty text is invalid.")))
+ (#error.Failure "Empty text is invalid.")))
dirty)
(#error.Success clean)
(text/= raw clean)
- (#error.Error error)
+ (#error.Failure error)
false))
)))
diff --git a/stdlib/test/test/lux/data/error.lux b/stdlib/test/test/lux/data/error.lux
index 30a12855d..4848443f9 100644
--- a/stdlib/test/test/lux/data/error.lux
+++ b/stdlib/test/test/lux/data/error.lux
@@ -5,54 +5,57 @@
[monad (#+ do Monad)]
pipe]
[data
- ["&" error]]]
+ ["/" error (#+ Error)]]]
lux/test)
(context: "Errors"
- (let [(^open "&/.") &.Apply<Error>
- (^open "&/.") &.Monad<Error>]
+ (let [(^open "//.") /.Apply<Error>
+ (^open "//.") /.Monad<Error>]
($_ seq
(test "Functor correctly handles both cases."
- (and (|> (: (&.Error Int) (#&.Success +10))
- (&/map inc)
- (case> (#&.Success +11) #1 _ #0))
+ (and (|> (: (Error Int) (#/.Success +10))
+ (//map inc)
+ (case> (#/.Success +11) #1 _ #0))
- (|> (: (&.Error Int) (#&.Error "YOLO"))
- (&/map inc)
- (case> (#&.Error "YOLO") #1 _ #0))
+ (|> (: (Error Int) (#/.Failure "YOLO"))
+ (//map inc)
+ (case> (#/.Failure "YOLO") #1 _ #0))
))
(test "Apply correctly handles both cases."
- (and (|> (&/wrap +20)
- (case> (#&.Success +20) #1 _ #0))
- (|> (&/apply (&/wrap inc) (&/wrap +10))
- (case> (#&.Success +11) #1 _ #0))
- (|> (&/apply (&/wrap inc) (#&.Error "YOLO"))
- (case> (#&.Error "YOLO") #1 _ #0))))
+ (and (|> (//wrap +20)
+ (case> (#/.Success +20) #1 _ #0))
+ (|> (//apply (//wrap inc) (//wrap +10))
+ (case> (#/.Success +11) #1 _ #0))
+ (|> (//apply (//wrap inc) (#/.Failure "YOLO"))
+ (case> (#/.Failure "YOLO") #1 _ #0))))
(test "Monad correctly handles both cases."
- (and (|> (do &.Monad<Error>
+ (and (|> (do /.Monad<Error>
[f (wrap i/+)
a (wrap +10)
b (wrap +20)]
(wrap (f a b)))
- (case> (#&.Success +30) #1 _ #0))
- (|> (do &.Monad<Error>
+ (case> (#/.Success +30) #1 _ #0))
+ (|> (do /.Monad<Error>
[f (wrap i/+)
- a (#&.Error "YOLO")
+ a (#/.Failure "YOLO")
b (wrap +20)]
(wrap (f a b)))
- (case> (#&.Error "YOLO") #1 _ #0))
+ (case> (#/.Failure "YOLO") #1 _ #0))
))
)))
(context: "Monad transformer"
- (let [lift (&.lift io.Monad<IO>)
+ (let [lift (/.lift io.Monad<IO>)
(^open "io/.") io.Monad<IO>]
(test "Can add error functionality to any monad."
- (|> (io.run (do (&.ErrorT io.Monad<IO>)
+ (|> (io.run (do (/.ErrorT io.Monad<IO>)
[a (lift (io/wrap +123))
b (wrap +456)]
(wrap (i/+ a b))))
- (case> (#&.Success +579) #1
- _ #0)))))
+ (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 0f905a844..9b6b3f9a1 100644
--- a/stdlib/test/test/lux/data/format/json.lux
+++ b/stdlib/test/test/lux/data/format/json.lux
@@ -7,7 +7,7 @@
pipe
["p" parser]]
[data
- ["e" error]
+ ["." error]
["." bit]
["." maybe]
["." number]
@@ -176,8 +176,8 @@
(^open "@/.") Codec<JSON,Record>]]
(test "Can encode/decode arbitrary types."
(|> sample @/encode @/decode
- (case> (#e.Success result)
+ (case> (#error.Success result)
(@/= sample result)
- (#e.Error error)
+ (#error.Failure error)
#0))))))
diff --git a/stdlib/test/test/lux/data/text/lexer.lux b/stdlib/test/test/lux/data/text/lexer.lux
index d87f91eb4..a08c49ef7 100644
--- a/stdlib/test/test/lux/data/text/lexer.lux
+++ b/stdlib/test/test/lux/data/text/lexer.lux
@@ -5,7 +5,7 @@
pipe
["p" parser]]
[data
- ["E" error]
+ ["." error (#+ Error)]
["." text ("text/." Equivalence<Text>)
format
["&" lexer]]
@@ -17,13 +17,13 @@
## [Utils]
(def: (should-fail input)
- (All [a] (-> (E.Error a) Bit))
+ (All [a] (-> (Error a) Bit))
(case input
(#.Left _) #1
_ #0))
(def: (should-passT test input)
- (-> Text (E.Error Text) Bit)
+ (-> Text (Error Text) Bit)
(case input
(#.Right output)
(text/= test output)
@@ -32,7 +32,7 @@
#0))
(def: (should-passL test input)
- (-> (List Text) (E.Error (List Text)) Bit)
+ (-> (List Text) (Error (List Text)) Bit)
(let [(^open "list/.") (list.Equivalence<List> text.Equivalence<Text>)]
(case input
(#.Right output)
@@ -42,7 +42,7 @@
#0)))
(def: (should-passE test input)
- (-> (Either Text Text) (E.Error (Either Text Text)) Bit)
+ (-> (Either Text Text) (Error (Either Text Text)) Bit)
(case input
(#.Right output)
(case [test output]
diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux
index 0bf7b8804..5fe3a6118 100644
--- a/stdlib/test/test/lux/macro/syntax.lux
+++ b/stdlib/test/test/lux/macro/syntax.lux
@@ -7,7 +7,7 @@
[data
["." bit]
["." name]
- ["e" error]
+ ["." error (#+ Error)]
["." number]
["." text
format]]
@@ -47,7 +47,7 @@
#0))
(def: (fails? input)
- (All [a] (-> (e.Error a) Bit))
+ (All [a] (-> (Error a) Bit))
(case input
(#.Left _)
#1
@@ -72,12 +72,12 @@
(found? (s.this? (<ctor> <value>)) (list (<ctor> <value>)))
(enforced? (s.this (<ctor> <value>)) (list (<ctor> <value>)))))]
- ["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]
- ["Can parse Frac syntax." +123.0 code.frac number.Equivalence<Frac> s.frac]
- ["Can parse Text syntax." text.new-line code.text text.Equivalence<Text> s.text]
+ ["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]
+ ["Can parse Frac syntax." +123.0 code.frac number.Equivalence<Frac> s.frac]
+ ["Can parse Text syntax." text.new-line code.text text.Equivalence<Text> s.text]
["Can parse Identifier syntax." ["yolo" "lol"] code.identifier name.Equivalence<Name> s.identifier]
["Can parse Tag syntax." ["yolo" "lol"] code.tag name.Equivalence<Name> s.tag]
)]
diff --git a/stdlib/test/test/lux/math/modular.lux b/stdlib/test/test/lux/math/modular.lux
index 559928304..f2a3bdef6 100644
--- a/stdlib/test/test/lux/math/modular.lux
+++ b/stdlib/test/test/lux/math/modular.lux
@@ -5,7 +5,7 @@
[data
["." product]
[bit ("bit/." Equivalence<Bit>)]
- ["e" error]
+ ["." error]
[text
format]]
[math
@@ -64,11 +64,11 @@
(do @
[_normalM modulusR
_alternativeM (|> modulusR (r.filter (|>> (i/= _normalM) not)))
- #let [normalM (|> _normalM /.from-int e.assume)
- alternativeM (|> _alternativeM /.from-int e.assume)]
+ #let [normalM (|> _normalM /.from-int error.assume)
+ alternativeM (|> _alternativeM /.from-int error.assume)]
[_param param] (modR normalM)
[_subject subject] (modR normalM)
- #let [copyM (|> normalM /.to-int /.from-int e.assume)]]
+ #let [copyM (|> normalM /.to-int /.from-int error.assume)]]
($_ seq
(test "Every modulus has a unique type, even if the numeric value is the same as another."
(and (type/= (:of normalM)
@@ -117,28 +117,28 @@
(test "Can encode/decode to text."
(let [(^open "mod/.") (/.Codec<Text,Mod> normalM)]
(case (|> subject mod/encode mod/decode)
- (#e.Success output)
+ (#error.Success output)
(/.m/= subject output)
- (#e.Error error)
+ (#error.Failure error)
#0)))
(test "Can equalize 2 moduli if they are equal."
(case (/.equalize (/.mod normalM _subject)
(/.mod copyM _param))
- (#e.Success paramC)
+ (#error.Success paramC)
(/.m/= param paramC)
- (#e.Error error)
+ (#error.Failure error)
#0))
(test "Cannot equalize 2 moduli if they are the different."
(case (/.equalize (/.mod normalM _subject)
(/.mod alternativeM _param))
- (#e.Success paramA)
+ (#error.Success paramA)
#0
- (#e.Error error)
+ (#error.Failure error)
#1))
(test "All numbers are congruent to themselves."
diff --git a/stdlib/test/test/lux/time/date.lux b/stdlib/test/test/lux/time/date.lux
index 602ecc78f..87734f22f 100644
--- a/stdlib/test/test/lux/time/date.lux
+++ b/stdlib/test/test/lux/time/date.lux
@@ -143,5 +143,5 @@
(case> (#error.Success decoded)
(@/= sample decoded)
- (#error.Error error)
+ (#error.Failure error)
#0))))))
diff --git a/stdlib/test/test/lux/time/instant.lux b/stdlib/test/test/lux/time/instant.lux
index 734456765..975c72558 100644
--- a/stdlib/test/test/lux/time/instant.lux
+++ b/stdlib/test/test/lux/time/instant.lux
@@ -95,5 +95,5 @@
## (case> (#error.Success decoded)
## (@/= sample decoded)
-## (#error.Error error)
+## (#error.Failure error)
## #0))))))
diff --git a/stdlib/test/test/lux/world/binary.lux b/stdlib/test/test/lux/world/binary.lux
index a6a6df9d6..c2f09abd8 100644
--- a/stdlib/test/test/lux/world/binary.lux
+++ b/stdlib/test/test/lux/world/binary.lux
@@ -3,7 +3,7 @@
[control
["." monad (#+ do)]]
[data
- ["e" error]
+ ["." error (#+ Error)]
["." number
["." i64]]
[collection
@@ -19,12 +19,12 @@
["_eq" equivalence]]]])
(def: (succeed result)
- (-> (e.Error Bit) Bit)
+ (-> (Error Bit) Bit)
(case result
- (#e.Error _)
+ (#error.Failure _)
#0
- (#e.Success output)
+ (#error.Success output)
output))
(def: #export (binary size)
@@ -34,17 +34,17 @@
(if (n/< size idx)
(do r.Monad<Random>
[byte r.nat]
- (exec (e.assume (/.write/8 idx byte output))
+ (exec (error.assume (/.write/8 idx byte output))
(recur (inc idx))))
(:: r.Monad<Random> wrap output)))))
(def: (bits-io bytes read write value)
- (-> Nat (-> Nat /.Binary (e.Error Nat)) (-> Nat Nat /.Binary (e.Error Any)) Nat Bit)
+ (-> Nat (-> Nat /.Binary (Error Nat)) (-> Nat Nat /.Binary (Error Any)) Nat Bit)
(let [binary (/.create 8)
bits (n/* 8 bytes)
capped-value (|> 1 (i64.left-shift bits) dec (i64.and value))]
(succeed
- (do e.Monad<Error>
+ (do error.Monad<Error>
[_ (write 0 value binary)
output (read 0 binary)]
(wrap (n/= capped-value output))))))
@@ -74,13 +74,13 @@
(bits-io 8 /.read/64 /.write/64 value))
(test "Can slice binaries."
(let [slice-size (|> to (n/- from) inc)
- random-slice (e.assume (/.slice from to random-binary))
+ random-slice (error.assume (/.slice from to random-binary))
idxs (list.n/range 0 (dec slice-size))
reader (function (_ binary idx) (/.read/8 idx binary))]
(and (n/= slice-size (/.size random-slice))
- (case [(monad.map e.Monad<Error> (reader random-slice) idxs)
- (monad.map e.Monad<Error> (|>> (n/+ from) (reader random-binary)) idxs)]
- [(#e.Success slice-vals) (#e.Success binary-vals)]
+ (case [(monad.map error.Monad<Error> (reader random-slice) idxs)
+ (monad.map error.Monad<Error> (|>> (n/+ from) (reader random-binary)) idxs)]
+ [(#error.Success slice-vals) (#error.Success binary-vals)]
(:: (list.Equivalence<List> number.Equivalence<Nat>) = slice-vals binary-vals)
_