aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/macro/code.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-17 01:48:49 -0400
committerEduardo Julian2021-07-17 01:48:49 -0400
commit2c99b4515447315d76a8dc203a2dbcafc09506ea (patch)
treeabb913a594de33855b49a218e7728417fa0f850b /stdlib/source/test/lux/macro/code.lux
parentbfacc0c96e56eedf788aba44bd8ad2848a35c390 (diff)
Now properly loading cached modules.
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/macro/code.lux101
1 files changed, 53 insertions, 48 deletions
diff --git a/stdlib/source/test/lux/macro/code.lux b/stdlib/source/test/lux/macro/code.lux
index 8a037cc08..f0764fda7 100644
--- a/stdlib/source/test/lux/macro/code.lux
+++ b/stdlib/source/test/lux/macro/code.lux
@@ -113,6 +113,57 @@
(list.zip/2 parts' parts')))]))
)))))
+(def: for_format
+ Test
+ (`` ($_ _.and
+ (~~ (template [<coverage> <random> <tag>]
+ [(do {! random.monad}
+ [expected <random>]
+ (_.cover [<coverage>]
+ (and (case (..read (/.format (<coverage> expected)))
+ (#try.Success actual)
+ (\ /.equivalence =
+ actual
+ (<coverage> expected))
+
+ (#try.Failure error)
+ false)
+ (\ /.equivalence =
+ [location.dummy (<tag> expected)]
+ (<coverage> expected)))))]
+
+ [/.bit random.bit #.Bit]
+ [/.nat random.nat #.Nat]
+ [/.int random.int #.Int]
+ [/.rev random.rev #.Rev]
+ [/.frac random.safe_frac #.Frac]
+ [/.text ..random_text #.Text]
+ [/.tag ..random_name #.Tag]
+ [/.identifier ..random_name #.Identifier]
+ [/.form (..random_sequence ..random) #.Form]
+ [/.tuple (..random_sequence ..random) #.Tuple]
+ [/.record (..random_record ..random) #.Record]))
+ (~~ (template [<coverage> <random> <tag>]
+ [(do {! random.monad}
+ [expected <random>]
+ (_.cover [<coverage>]
+ (and (case (..read (/.format (<coverage> expected)))
+ (#try.Success actual)
+ (\ /.equivalence =
+ actual
+ (<coverage> expected))
+
+ (#try.Failure error)
+ false)
+ (\ /.equivalence =
+ [location.dummy (<tag> ["" expected])]
+ (<coverage> expected)))
+ ))]
+
+ [/.local_tag ..random_text #.Tag]
+ [/.local_identifier ..random_text #.Identifier]
+ )))))
+
(def: #export test
Test
(<| (_.covering /._)
@@ -121,54 +172,8 @@
($equivalence.spec /.equivalence ..random))
(_.for [/.format]
- (`` ($_ _.and
- (~~ (template [<coverage> <random> <tag>]
- [(do {! random.monad}
- [expected <random>]
- (_.cover [<coverage>]
- (and (case (..read (/.format (<coverage> expected)))
- (#try.Success actual)
- (\ /.equivalence =
- actual
- (<coverage> expected))
-
- (#try.Failure error)
- false)
- (\ /.equivalence =
- [location.dummy (<tag> expected)]
- (<coverage> expected)))))]
-
- [/.bit random.bit #.Bit]
- [/.nat random.nat #.Nat]
- [/.int random.int #.Int]
- [/.rev random.rev #.Rev]
- [/.frac random.safe_frac #.Frac]
- [/.text ..random_text #.Text]
- [/.tag ..random_name #.Tag]
- [/.identifier ..random_name #.Identifier]
- [/.form (..random_sequence ..random) #.Form]
- [/.tuple (..random_sequence ..random) #.Tuple]
- [/.record (..random_record ..random) #.Record]))
- (~~ (template [<coverage> <random> <tag>]
- [(do {! random.monad}
- [expected <random>]
- (_.cover [<coverage>]
- (and (case (..read (/.format (<coverage> expected)))
- (#try.Success actual)
- (\ /.equivalence =
- actual
- (<coverage> expected))
-
- (#try.Failure error)
- false)
- (\ /.equivalence =
- [location.dummy (<tag> ["" expected])]
- (<coverage> expected)))
- ))]
-
- [/.local_tag ..random_text #.Tag]
- [/.local_identifier ..random_text #.Identifier]
- )))))
+ ..for_format)
+
(do {! random.monad}
[[original substitute] (random.filter (function (_ [original substitute])
(not (\ /.equivalence = original substitute)))