aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/artifact/snapshot.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-01-26 19:11:14 -0400
committerEduardo Julian2021-01-26 19:11:14 -0400
commit43d28326ad59c74439b96343cc8f619ed7d90231 (patch)
tree3f410d48bfca7d8141e2e7fda0f8d978934dd5c2 /stdlib/source/test/aedifex/artifact/snapshot.lux
parentae56acf791c2ed9bd5865f85fffa00b025d310fe (diff)
Made the Python being generated more compatible with both P2.7 and P3.
Diffstat (limited to 'stdlib/source/test/aedifex/artifact/snapshot.lux')
-rw-r--r--stdlib/source/test/aedifex/artifact/snapshot.lux48
1 files changed, 48 insertions, 0 deletions
diff --git a/stdlib/source/test/aedifex/artifact/snapshot.lux b/stdlib/source/test/aedifex/artifact/snapshot.lux
new file mode 100644
index 000000000..1bdb9ca2d
--- /dev/null
+++ b/stdlib/source/test/aedifex/artifact/snapshot.lux
@@ -0,0 +1,48 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]
+ {[0 #spec]
+ [/
+ ["$." equivalence]]}]
+ [control
+ ["." try ("#\." functor)]
+ [parser
+ ["<.>" xml]]]
+ [math
+ ["." random (#+ Random) ("#\." monad)]]]
+ ["$." / #_
+ ["#." build]
+ ["#." time]
+ ["#." stamp]]
+ {#program
+ ["." /]})
+
+(def: #export random
+ (Random /.Snapshot)
+ (random.or (random\wrap [])
+ $/stamp.random))
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Snapshot]
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+
+ (do random.monad
+ [expected ..random]
+ (_.cover [/.format /.parser]
+ (|> expected
+ /.format
+ list
+ (<xml>.run /.parser)
+ (try\map (\ /.equivalence = expected))
+ (try.default false))))
+
+ $/build.test
+ $/time.test
+ $/stamp.test
+ ))))