From 43d28326ad59c74439b96343cc8f619ed7d90231 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 26 Jan 2021 19:11:14 -0400 Subject: Made the Python being generated more compatible with both P2.7 and P3. --- stdlib/source/test/aedifex/artifact/snapshot.lux | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 stdlib/source/test/aedifex/artifact/snapshot.lux (limited to 'stdlib/source/test/aedifex/artifact/snapshot.lux') 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 + (.run /.parser) + (try\map (\ /.equivalence = expected)) + (try.default false)))) + + $/build.test + $/time.test + $/stamp.test + )))) -- cgit v1.2.3