diff options
Diffstat (limited to 'stdlib/source/test/aedifex')
-rw-r--r-- | stdlib/source/test/aedifex/artifact/snapshot.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/artifact/snapshot/version.lux | 46 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/artifact/time.lux | 10 |
3 files changed, 56 insertions, 4 deletions
diff --git a/stdlib/source/test/aedifex/artifact/snapshot.lux b/stdlib/source/test/aedifex/artifact/snapshot.lux index 1bdb9ca2d..371fde55e 100644 --- a/stdlib/source/test/aedifex/artifact/snapshot.lux +++ b/stdlib/source/test/aedifex/artifact/snapshot.lux @@ -15,7 +15,8 @@ ["$." / #_ ["#." build] ["#." time] - ["#." stamp]] + ["#." stamp] + ["#." version]] {#program ["." /]}) @@ -45,4 +46,5 @@ $/build.test $/time.test $/stamp.test + $/version.test )))) diff --git a/stdlib/source/test/aedifex/artifact/snapshot/version.lux b/stdlib/source/test/aedifex/artifact/snapshot/version.lux new file mode 100644 index 000000000..e08691c3c --- /dev/null +++ b/stdlib/source/test/aedifex/artifact/snapshot/version.lux @@ -0,0 +1,46 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)] + {[0 #spec] + [/ + ["$." equivalence]]}] + [control + ["." try ("#\." functor)] + [parser + ["<.>" xml]]] + [math + ["." random (#+ Random)]]] + {#program + ["." /]} + ["$." /// #_ + ["#." type] + ["#." time]]) + +(def: #export random + (Random /.Version) + ($_ random.and + $///type.random + (random.ascii/alpha 1) + $///time.random + )) + +(def: #export test + Test + (<| (_.covering /._) + (_.for [/.Version]) + ($_ _.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)))) + ))) diff --git a/stdlib/source/test/aedifex/artifact/time.lux b/stdlib/source/test/aedifex/artifact/time.lux index 880bc1f83..4bf63018c 100644 --- a/stdlib/source/test/aedifex/artifact/time.lux +++ b/stdlib/source/test/aedifex/artifact/time.lux @@ -11,7 +11,7 @@ [parser ["<.>" text]]] [math - ["." random]] + ["." random (#+ Random)]] [time ["." instant]]] {#program @@ -20,16 +20,20 @@ ["#." date] ["#." time]]) +(def: #export random + (Random /.Time) + random.instant) + (def: #export test Test (<| (_.covering /._) (_.for [/.Time]) ($_ _.and (_.for [/.equivalence] - ($equivalence.spec /.equivalence random.instant)) + ($equivalence.spec /.equivalence ..random)) (do random.monad - [expected random.instant] + [expected ..random] (_.cover [/.format /.parser] (|> expected /.format |