aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/debug.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/debug.lux')
-rw-r--r--stdlib/source/test/lux/debug.lux134
1 files changed, 67 insertions, 67 deletions
diff --git a/stdlib/source/test/lux/debug.lux b/stdlib/source/test/lux/debug.lux
index 79bc194a8..3965359b5 100644
--- a/stdlib/source/test/lux/debug.lux
+++ b/stdlib/source/test/lux/debug.lux
@@ -162,34 +162,34 @@
can_represent_complex_types! ..can_represent_complex_types
can_represent_time_types! ..can_represent_time_types]
(all _.and
- (_.cover [/.representation]
- (`` (and can_represent_simple_types!
- can_represent_structure_types!
- can_represent_complex_types!
- can_represent_time_types!
-
- (|> (/.representation .Any sample_frac)
- (try#each (text#= "[]"))
- (try.else false))
- (|> (/.representation (type (List Nat)) (is (List Nat) (list sample_nat)))
- (try#each (text#= (%.list %.nat (list sample_nat))))
- (try.else false))
- (~~ (template [<sample>]
- [(|> (/.representation (type (Maybe Nat)) (is (Maybe Nat) <sample>))
- (try#each (text#= (%.maybe %.nat <sample>)))
- (try.else false))]
-
- [{.#Some sample_nat}]
- [{.#None}]
- ))
- )))
- (_.cover [/.cannot_represent_value]
- (case (/.representation (-> Nat Nat) (|>>))
- {try.#Success representation}
- false
+ (_.coverage [/.representation]
+ (`` (and can_represent_simple_types!
+ can_represent_structure_types!
+ can_represent_complex_types!
+ can_represent_time_types!
+
+ (|> (/.representation .Any sample_frac)
+ (try#each (text#= "[]"))
+ (try.else false))
+ (|> (/.representation (type (List Nat)) (is (List Nat) (list sample_nat)))
+ (try#each (text#= (%.list %.nat (list sample_nat))))
+ (try.else false))
+ (~~ (template [<sample>]
+ [(|> (/.representation (type (Maybe Nat)) (is (Maybe Nat) <sample>))
+ (try#each (text#= (%.maybe %.nat <sample>)))
+ (try.else false))]
+
+ [{.#Some sample_nat}]
+ [{.#None}]
+ ))
+ )))
+ (_.coverage [/.cannot_represent_value]
+ (case (/.representation (-> Nat Nat) (|>>))
+ {try.#Success representation}
+ false
- {try.#Failure error}
- (exception.match? /.cannot_represent_value error)))
+ {try.#Failure error}
+ (exception.match? /.cannot_represent_value error)))
)))
(def: inspection
@@ -199,22 +199,22 @@
sample_int random.int
sample_frac random.frac
sample_text (random.upper_case 10)]
- (_.cover [/.inspection]
- (`` (and (~~ (template [<format> <sample>]
- [(text#= (<format> <sample>) (/.inspection <sample>))]
+ (_.coverage [/.inspection]
+ (`` (and (~~ (template [<format> <sample>]
+ [(text#= (<format> <sample>) (/.inspection <sample>))]
- [%.bit sample_bit]
- [%.int sample_int]
- [%.frac sample_frac]
- [%.text sample_text]
- ))
- (text#= (|> (list sample_bit sample_int sample_frac sample_text)
- (is (List Any))
- (list#each /.inspection)
- (text.interposed " ")
- (text.enclosed ["[" "]"]))
- (/.inspection [sample_bit sample_int sample_frac sample_text]))
- )))))
+ [%.bit sample_bit]
+ [%.int sample_int]
+ [%.frac sample_frac]
+ [%.text sample_text]
+ ))
+ (text#= (|> (list sample_bit sample_int sample_frac sample_text)
+ (is (List Any))
+ (list#each /.inspection)
+ (text.interposed " ")
+ (text.enclosed ["[" "]"]))
+ (/.inspection [sample_bit sample_int sample_frac sample_text]))
+ )))))
(syntax: (macro_error [macro <code>.any])
(function (_ compiler)
@@ -236,33 +236,33 @@
(all _.and
..inspection
..representation
- (_.cover [/.hole /.type_hole]
- (let [error (is My_Text (..macro_error (/.hole)))]
- (and (exception.match? /.type_hole error)
- (text.contains? (%.type My_Text) error))))
+ (_.coverage [/.hole /.type_hole]
+ (let [error (is My_Text (..macro_error (/.hole)))]
+ (and (exception.match? /.type_hole error)
+ (text.contains? (%.type My_Text) error))))
(do random.monad
[foo (random.upper_case 10)
bar random.nat
baz random.bit]
- (_.cover [/.here]
- (with_expansions [<no_parameters> (for @.js (~~ (these))
- (~~ (these (/.here))))]
- (`` (exec
- <no_parameters>
- (/.here foo
- [bar %.nat])
- true)))))
- (_.cover [/.unknown_local_binding]
- (exception.match? /.unknown_local_binding
- (..macro_error (/.here yolo))))
- (_.cover [/.private]
- (exec
- (is (/.private /.Inspector)
- /.inspection)
- true))
- (_.cover [/.log!]
- (exec
- (/.log! (format (%.symbol (symbol /.log!))
- " works: " (%.text message)))
- true))
+ (_.coverage [/.here]
+ (with_expansions [<no_parameters> (for @.js (~~ (these))
+ (~~ (these (/.here))))]
+ (`` (exec
+ <no_parameters>
+ (/.here foo
+ [bar %.nat])
+ true)))))
+ (_.coverage [/.unknown_local_binding]
+ (exception.match? /.unknown_local_binding
+ (..macro_error (/.here yolo))))
+ (_.coverage [/.private]
+ (exec
+ (is (/.private /.Inspector)
+ /.inspection)
+ true))
+ (_.coverage [/.log!]
+ (exec
+ (/.log! (format (%.symbol (symbol /.log!))
+ " works: " (%.text message)))
+ true))
))))