aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/artifact/snapshot
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/aedifex/artifact/snapshot/build.lux (renamed from stdlib/source/test/aedifex/artifact/build.lux)11
-rw-r--r--stdlib/source/test/aedifex/artifact/snapshot/stamp.lux48
-rw-r--r--stdlib/source/test/aedifex/artifact/snapshot/time.lux42
3 files changed, 98 insertions, 3 deletions
diff --git a/stdlib/source/test/aedifex/artifact/build.lux b/stdlib/source/test/aedifex/artifact/snapshot/build.lux
index d0920b44c..e3fdcab62 100644
--- a/stdlib/source/test/aedifex/artifact/build.lux
+++ b/stdlib/source/test/aedifex/artifact/snapshot/build.lux
@@ -11,23 +11,28 @@
[parser
["<.>" xml]]]
[math
- ["." random]]]
+ ["." random (#+ Random)]]]
{#program
["." /]})
+(def: #export random
+ (Random /.Build)
+ random.nat)
+
(def: #export test
Test
(<| (_.covering /._)
(_.for [/.Build]
($_ _.and
(_.for [/.equivalence]
- ($equivalence.spec /.equivalence random.nat))
+ ($equivalence.spec /.equivalence ..random))
(do random.monad
- [expected random.nat]
+ [expected ..random]
(_.cover [/.format /.parser]
(|> expected
/.format
+ list
(<xml>.run /.parser)
(try\map (\ /.equivalence = expected))
(try.default false))))
diff --git a/stdlib/source/test/aedifex/artifact/snapshot/stamp.lux b/stdlib/source/test/aedifex/artifact/snapshot/stamp.lux
new file mode 100644
index 000000000..aab722cad
--- /dev/null
+++ b/stdlib/source/test/aedifex/artifact/snapshot/stamp.lux
@@ -0,0 +1,48 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]
+ {[0 #spec]
+ [/
+ ["$." equivalence]]}]
+ [control
+ ["." try ("#\." functor)]
+ [parser
+ ["<.>" xml]]]
+ [math
+ ["." random (#+ Random)]]
+ [time
+ ["." instant]]]
+ {#program
+ ["." /]}
+ ["$." // #_
+ ["#." time]
+ ["#." build]])
+
+(def: #export random
+ (Random /.Stamp)
+ ($_ random.and
+ $//time.random
+ $//build.random
+ ))
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Stamp])
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+
+ (do random.monad
+ [expected ..random]
+ ($_ _.and
+ (_.cover [/.format /.parser]
+ (|> expected
+ /.format
+ (<xml>.run' /.parser)
+ (try\map (\ instant.equivalence = expected))
+ (try.default false)))
+ ))
+ )))
diff --git a/stdlib/source/test/aedifex/artifact/snapshot/time.lux b/stdlib/source/test/aedifex/artifact/snapshot/time.lux
new file mode 100644
index 000000000..567c70ce4
--- /dev/null
+++ b/stdlib/source/test/aedifex/artifact/snapshot/time.lux
@@ -0,0 +1,42 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]
+ {[0 #spec]
+ [/
+ ["$." equivalence]]}]
+ [control
+ ["." try ("#\." functor)]
+ [parser
+ ["<.>" text]]]
+ [math
+ ["." random (#+ Random)]]
+ [time
+ ["." instant]]]
+ {#program
+ ["." /]})
+
+(def: #export random
+ (Random /.Time)
+ random.instant)
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Time])
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+
+ (do random.monad
+ [expected ..random]
+ ($_ _.and
+ (_.cover [/.format /.parser]
+ (|> expected
+ /.format
+ (<text>.run /.parser)
+ (try\map (\ instant.equivalence = expected))
+ (try.default false)))
+ ))
+ )))