aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/type/poly/json.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-09-08 00:22:45 -0400
committerEduardo Julian2021-09-08 00:22:45 -0400
commit964ec62d4fbcc1fb2336a3de355ce3554ef7eb04 (patch)
tree04ae6f260d3345772a86849b6f969a9d87e959c8 /stdlib/source/test/lux/type/poly/json.lux
parentac419f9e94bc3b82cfb78c41e91b08b308a2ac71 (diff)
Now using eval to derive code for arbitrary types.
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/type/poly/json.lux18
1 files changed, 11 insertions, 7 deletions
diff --git a/stdlib/source/test/lux/type/poly/json.lux b/stdlib/source/test/lux/type/poly/json.lux
index 6abaa47f1..259a25b95 100644
--- a/stdlib/source/test/lux/type/poly/json.lux
+++ b/stdlib/source/test/lux/type/poly/json.lux
@@ -2,6 +2,7 @@
[library
[lux {"-" [Variant Record]}
["_" test {"+" [Test]}]
+ ["@" target]
["[0]" debug]
[abstract
codec
@@ -21,7 +22,7 @@
["[0]" bit]
["[0]" text]
[format
- [json {"+" []}
+ [json {"+" [JSON]}
[\\poly
["[0]" /]]]]
[collection
@@ -29,7 +30,6 @@
["d" dictionary]
["[0]" list]]]
[type
- [poly {"+" [derived:]}]
["[0]" unit]]
[math
["[0]" random {"+" [Random]}]
@@ -108,14 +108,18 @@
..qty
)))
-(derived: equivalence
- (poly/equivalence.equivalence Record))
+(for {@.old (as_is)}
+ (as_is (def: equivalence
+ (Equivalence Record)
+ (poly/equivalence.equivalence Record))
-(derived: codec
- (/.codec Record))
+ (def: codec
+ (Codec JSON Record)
+ (/.codec Record))))
(def: .public test
Test
(<| (_.covering /._)
(_.for [/.codec]
- ($codec.spec ..equivalence ..codec ..gen_record))))
+ (for {@.old (_.test "PLACEHOLDER" true)}
+ ($codec.spec ..equivalence ..codec ..gen_record)))))