diff options
Diffstat (limited to 'stdlib/source/test/lux/type/poly/json.lux')
-rw-r--r-- | stdlib/source/test/lux/type/poly/json.lux | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/stdlib/source/test/lux/type/poly/json.lux b/stdlib/source/test/lux/type/poly/json.lux deleted file mode 100644 index 3ec8050a6..000000000 --- a/stdlib/source/test/lux/type/poly/json.lux +++ /dev/null @@ -1,124 +0,0 @@ -(.using - [library - [lux (.except Variant Record) - ["_" test (.only Test)] - ["@" target] - ["[0]" debug] - [abstract - [codec (.except)] - [monad (.only do)] - ["[0]" equivalence (.only Equivalence) - ["poly/[1]" \\poly]] - [\\specification - ["$[0]" equivalence] - ["$[0]" codec]]] - [control - ["[0]" try] - ["p" parser - ... TODO: Get rid of this import ASAP - [json (.only)]]] - [data - ["[0]" bit] - ["[0]" text] - [format - [json (.only JSON) - [\\poly - ["[0]" /]]]] - [collection - [sequence (.only sequence)] - ["d" dictionary] - ["[0]" list]]] - [type - ["[0]" unit]] - [math - ["[0]" random (.only Random)] - [number - ["n" nat] - ["[0]" frac]]] - [time - ["ti" instant] - ["tda" date] - ... ["tdu" duration] - ]]] - [test - [lux - [time - ["_[0]" instant] - ... ["_[0]" duration] - ]]]) - -(type: Variant - (.Variant - {#Bit Bit} - {#Text Text} - {#Frac Frac})) - -(type: Recursive - (Rec Recursive - (.Variant - {#Number Frac} - {#Addition Frac Recursive}))) - -(type: Record - (.Record - [#bit Bit - #frac Frac - #text Text - #maybe (Maybe Frac) - #list (List Frac) - #dictionary (d.Dictionary Text Frac) - #variant Variant - #tuple [Bit Text Frac] - #recursive Recursive - ... #instant ti.Instant - ... #duration tdu.Duration - #date tda.Date - #grams (unit.Qty unit.Gram)])) - -(def: gen_recursive - (Random Recursive) - (random.rec - (function (_ gen_recursive) - (random.or random.safe_frac - (random.and random.safe_frac - gen_recursive))))) - -(def: qty - (All (_ unit) (Random (unit.Qty unit))) - (at random.monad each (debug.private unit.in') random.int)) - -(def: gen_record - (Random Record) - (do [! random.monad] - [size (at ! each (n.% 2) random.nat)] - (all random.and - random.bit - random.safe_frac - (random.unicode size) - (random.maybe random.safe_frac) - (random.list size random.safe_frac) - (random.dictionary text.hash size (random.unicode size) random.safe_frac) - (all random.or random.bit (random.unicode size) random.safe_frac) - (all random.and random.bit (random.unicode size) random.safe_frac) - ..gen_recursive - ... _instant.instant - ... _duration.duration - random.date - ..qty - ))) - -(for @.old (these) - (these (def: equivalence - (Equivalence Record) - (poly/equivalence.equivalence Record)) - - (def: codec - (Codec JSON Record) - (/.codec Record)))) - -(def: .public test - Test - (<| (_.covering /._) - (_.for [/.codec] - (for @.old (_.property "PLACEHOLDER" true) - ($codec.spec ..equivalence ..codec ..gen_record))))) |