aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/tool/compiler/phase/analysis/primitive.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/tool/compiler/phase/analysis/primitive.lux')
-rw-r--r--stdlib/source/test/lux/tool/compiler/phase/analysis/primitive.lux21
1 files changed, 10 insertions, 11 deletions
diff --git a/stdlib/source/test/lux/tool/compiler/phase/analysis/primitive.lux b/stdlib/source/test/lux/tool/compiler/phase/analysis/primitive.lux
index 1a7aec26f..57c3152d9 100644
--- a/stdlib/source/test/lux/tool/compiler/phase/analysis/primitive.lux
+++ b/stdlib/source/test/lux/tool/compiler/phase/analysis/primitive.lux
@@ -9,9 +9,8 @@
["_" test (#+ Test)]
[control
pipe
+ ["." try (#+ Try)]
["." exception (#+ exception:)]]
- [data
- ["." error (#+ Error)]]
["." type ("#@." equivalence)]
[macro
["." code]]]
@@ -32,12 +31,12 @@
(def: #export (expander macro inputs state)
Expander
- (#error.Failure "NOPE"))
+ (#try.Failure "NOPE"))
(def: #export (eval count type expression)
Eval
(function (_ state)
- (#error.Failure "NO!")))
+ (#try.Failure "NO!")))
(def: #export phase
////analysis.Phase
@@ -69,24 +68,24 @@
["Inferred" (%.type inferred)]))
(def: (infer expected-type analysis)
- (-> Type (Operation Analysis) (Error Analysis))
+ (-> Type (Operation Analysis) (Try Analysis))
(|> analysis
//type.with-inference
(///.run ..state)
- (case> (#error.Success [inferred-type output])
+ (case> (#try.Success [inferred-type output])
(if (is? expected-type inferred-type)
- (#error.Success output)
+ (#try.Success output)
(exception.throw wrong-inference [expected-type inferred-type]))
- (#error.Failure error)
- (#error.Failure error))))
+ (#try.Failure error)
+ (#try.Failure error))))
(def: #export test
(<| (_.context (name.module (name-of /._)))
(`` ($_ _.and
(_.test (%.name (name-of #////analysis.Unit))
(|> (infer Any (..phase (' [])))
- (case> (^ (#error.Success (#////analysis.Primitive (#////analysis.Unit output))))
+ (case> (^ (#try.Success (#////analysis.Primitive (#////analysis.Unit output))))
(is? [] output)
_
@@ -96,7 +95,7 @@
[sample <random>]
(_.test (%.name (name-of <tag>))
(|> (infer <type> (..phase (<constructor> sample)))
- (case> (#error.Success (#////analysis.Primitive (<tag> output)))
+ (case> (#try.Success (#////analysis.Primitive (<tag> output)))
(is? sample output)
_