aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test')
-rw-r--r--stdlib/source/test/lux/meta.lux127
-rw-r--r--stdlib/source/test/lux/world/environment.lux4
2 files changed, 63 insertions, 68 deletions
diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux
index 8fd22359c..1b037cb8a 100644
--- a/stdlib/source/test/lux/meta.lux
+++ b/stdlib/source/test/lux/meta.lux
@@ -856,24 +856,34 @@
(list#each (|>> [label_module])
{.#Item tags_0}))
last (-- (list.size cohort))
- right? (n.= last)]
+ right? (n.= last)
+ lefts (is (-> Nat Nat)
+ (function (_ index)
+ (if (right? index)
+ (-- index)
+ index)))]
(|> {.#Item tags_0}
list.enumeration
(list#each (function (_ [index short])
[short [true {.#Definition [.Tag
- (|> [{.#Some [index (right? index) cohort]} type_0]
+ (|> [{.#Some [(lefts index) (right? index) cohort]} type_0]
(is Label)
(as .Tag))]}]]))))
(let [cohort (is (List Symbol)
(list#each (|>> [label_module])
{.#Item tags_1}))
last (-- (list.size cohort))
- right? (n.= last)]
+ right? (n.= last)
+ lefts (is (-> Nat Nat)
+ (function (_ index)
+ (if (right? index)
+ (-- index)
+ index)))]
(|> {.#Item tags_1}
list.enumeration
(list#each (function (_ [index short])
[short [true {.#Definition [.Slot
- (|> [{.#Some [index (right? index) cohort]} type_1]
+ (|> [{.#Some [(lefts index) (right? index) cohort]} type_1]
(is Label)
(as .Slot))]}]]))))))
.#imports (list)
@@ -888,72 +898,55 @@
.#extensions []
.#eval (as (-> Type Code (Meta Any)) [])
.#host []])]]
- (all _.and
- (_.coverage [/.tag_lists]
- (let [equivalence (list.equivalence
- (product.equivalence
- (list.equivalence symbol.equivalence)
- type.equivalence))]
- (|> (/.tag_lists label_module)
- (/.result expected_lux)
- (try#each (of equivalence = (list [(list#each (|>> [label_module]) {.#Item tags_1})
- type_1])))
- (try.else false))))
- (_.coverage [/.tags_of]
- (|> (/.tags_of [label_module name_1])
- (/.result expected_lux)
- (try#each (of (maybe.equivalence (list.equivalence symbol.equivalence)) =
- {.#Some (list#each (|>> [label_module]) {.#Item tags_1})}))
- (try.else false)))
- ... (_.coverage [/.tag]
- ... (|> {.#Item tags_0}
- ... list.enumeration
- ... (list.every? (function (_ [expected_index label])
- ... (|> [label_module label]
- ... /.tag
- ... (/.result expected_lux)
- ... (!expect (^.multi {try.#Success [actual_index actual_tags actual_type]}
- ... (let [correct_index!
- ... (n.= expected_index
- ... actual_index)
-
- ... correct_tags!
- ... (of (list.equivalence symbol.equivalence) =
- ... (list#each (|>> [label_module]) {.#Item tags_0})
- ... actual_tags)
+ (`` (all _.and
+ (_.coverage [/.tag_lists]
+ (let [equivalence (list.equivalence
+ (product.equivalence
+ (list.equivalence symbol.equivalence)
+ type.equivalence))]
+ (|> (/.tag_lists label_module)
+ (/.result expected_lux)
+ (try#each (of equivalence = (list [(list#each (|>> [label_module]) {.#Item tags_1})
+ type_1])))
+ (try.else false))))
+ (_.coverage [/.tags_of]
+ (|> (/.tags_of [label_module name_1])
+ (/.result expected_lux)
+ (try#each (of (maybe.equivalence (list.equivalence symbol.equivalence)) =
+ {.#Some (list#each (|>> [label_module]) {.#Item tags_1})}))
+ (try.else false)))
+ (,, (with_template [<label> <cohort> <type>]
+ [(_.coverage [<label>]
+ (|> {.#Item <cohort>}
+ list.enumeration
+ (list.every? (function (_ [expected_index label])
+ (|> [label_module label]
+ <label>
+ (/.result expected_lux)
+ (!expect (^.multi {try.#Success [{.#Some [actual_lefts actual_right? actual_cohort]} actual_type]}
+ (let [correct_index!
+ (n.= expected_index
+ (if actual_right?
+ (++ actual_lefts)
+ actual_lefts))
- ... correct_type!
- ... (type#= type_0
- ... actual_type)]
- ... (and correct_index!
- ... correct_tags!
- ... correct_type!))))
- ... )))))
- ... (_.coverage [/.slot]
- ... (|> {.#Item tags_1}
- ... list.enumeration
- ... (list.every? (function (_ [expected_index label])
- ... (|> [label_module label]
- ... /.slot
- ... (/.result expected_lux)
- ... (!expect (^.multi {try.#Success [actual_index actual_tags actual_type]}
- ... (let [correct_index!
- ... (n.= expected_index
- ... actual_index)
+ correct_tags!
+ (of (list.equivalence symbol.equivalence) =
+ (list#each (|>> [label_module]) {.#Item <cohort>})
+ actual_cohort)
- ... correct_tags!
- ... (of (list.equivalence symbol.equivalence) =
- ... (list#each (|>> [label_module]) {.#Item tags_1})
- ... actual_tags)
+ correct_type!
+ (type#= <type>
+ actual_type)]
+ (and correct_index!
+ correct_tags!
+ correct_type!))))
+ )))))]
- ... correct_type!
- ... (type#= type_1
- ... actual_type)]
- ... (and correct_index!
- ... correct_tags!
- ... correct_type!))))
- ... )))))
- )))
+ [/.tag tags_0 type_0]
+ [/.slot tags_1 type_1]
+ ))
+ ))))
(def injection
(Injection Meta)
diff --git a/stdlib/source/test/lux/world/environment.lux b/stdlib/source/test/lux/world/environment.lux
index c02fbfbc3..5cff3b16d 100644
--- a/stdlib/source/test/lux/world/environment.lux
+++ b/stdlib/source/test/lux/world/environment.lux
@@ -40,7 +40,9 @@
[exit random.int]
(in (do [! async.monad]
[environment (/.environment ! subject)]
- (unit.coverage [/.Environment]
+ (unit.coverage [/.Environment
+
+ /.available_variables /.variable /.home /.directory /.exit]
(and (not (dictionary.empty? environment))
(list.every? (|>> text.empty? not)
(dictionary.keys environment))