aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/macro/poly/json.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/macro/poly/json.lux')
-rw-r--r--stdlib/source/test/lux/macro/poly/json.lux47
1 files changed, 24 insertions, 23 deletions
diff --git a/stdlib/source/test/lux/macro/poly/json.lux b/stdlib/source/test/lux/macro/poly/json.lux
index 5e0bcfbd4..55b2d2dd2 100644
--- a/stdlib/source/test/lux/macro/poly/json.lux
+++ b/stdlib/source/test/lux/macro/poly/json.lux
@@ -1,6 +1,5 @@
(.module:
[lux #*
- ["%" data/text/format (#+ format)]
["_" test (#+ Test)]
[abstract
codec
@@ -20,7 +19,8 @@
[data
["." bit]
["." maybe]
- ["." text]
+ ["." text
+ ["%" format (#+ format)]]
[number
["n" nat]
["." frac]]
@@ -37,7 +37,7 @@
[type
["." unit]]
[math
- ["r" random (#+ Random)]]
+ ["." random (#+ Random)]]
[time
["ti" instant]
["tda" date]
@@ -67,39 +67,39 @@
#list (List Frac)
#dictionary (d.Dictionary Text Frac)
#variant Variant
- #tuple [Bit Frac Text]
+ #tuple [Bit Text Frac]
#recursive Recursive
## #instant ti.Instant
## #duration tdu.Duration
#date tda.Date
- #grams (unit.Qty unit.Gram)
- })
+ #grams (unit.Qty unit.Gram)})
(def: gen-recursive
(Random Recursive)
- (r.rec (function (_ gen-recursive)
- (r.or r.frac
- (r.and r.frac gen-recursive)))))
+ (random.rec
+ (function (_ gen-recursive)
+ (random.or random.frac
+ (random.and random.frac gen-recursive)))))
(derived: recursive-equivalence (poly/equivalence.equivalence Recursive))
(def: qty
(All [unit] (Random (unit.Qty unit)))
- (|> r.int (:: r.monad map unit.in)))
+ (|> random.int (:: random.monad map unit.in)))
(def: gen-record
(Random Record)
- (do {@ r.monad}
- [size (:: @ map (n.% 2) r.nat)]
- ($_ r.and
- r.bit
- r.frac
- (r.unicode size)
- (r.maybe r.frac)
- (r.list size r.frac)
- (r.dictionary text.hash size (r.unicode size) r.frac)
- ($_ r.or r.bit (r.unicode size) r.frac)
- ($_ r.and r.bit r.frac (r.unicode size))
+ (do {@ random.monad}
+ [size (:: @ map (n.% 2) random.nat)]
+ ($_ random.and
+ random.bit
+ random.frac
+ (random.unicode size)
+ (random.maybe random.frac)
+ (random.list size random.frac)
+ (random.dictionary text.hash size (random.unicode size) random.frac)
+ ($_ random.or random.bit (random.unicode size) random.frac)
+ ($_ random.and random.bit (random.unicode size) random.frac)
..gen-recursive
## _instant.instant
## _duration.duration
@@ -112,5 +112,6 @@
(def: #export test
Test
- (<| (_.context (%.name (name-of /._)))
- ($codec.spec ..equivalence ..codec gen-record)))
+ (<| (_.covering /._)
+ (_.with-cover [/.codec]
+ ($codec.spec ..equivalence ..codec ..gen-record))))