diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/aedifex/artifact.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/artifact/versioning.lux | 43 |
2 files changed, 45 insertions, 0 deletions
diff --git a/stdlib/source/test/aedifex/artifact.lux b/stdlib/source/test/aedifex/artifact.lux index 7409a65e2..7d91ebed7 100644 --- a/stdlib/source/test/aedifex/artifact.lux +++ b/stdlib/source/test/aedifex/artifact.lux @@ -22,6 +22,7 @@ ["#." type] ["#." extension] ["#." value] + ["#." versioning] ["#." time_stamp ["#/." date] ["#/." time]]] @@ -47,6 +48,7 @@ /type.test /extension.test /value.test + /versioning.test /time_stamp.test /time_stamp/date.test /time_stamp/time.test diff --git a/stdlib/source/test/aedifex/artifact/versioning.lux b/stdlib/source/test/aedifex/artifact/versioning.lux new file mode 100644 index 000000000..c0704440e --- /dev/null +++ b/stdlib/source/test/aedifex/artifact/versioning.lux @@ -0,0 +1,43 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)] + {[0 #spec] + [/ + ["$." equivalence]]}] + [control + ["." try ("#\." functor)] + [parser + ["<.>" xml]]] + [math + ["." random (#+ Random)]]] + {#program + ["." /]}) + +(def: #export random + (Random /.Versioning) + ($_ random.and + random.instant + random.nat + (random.list 5 (random.ascii/lower_alpha 3)) + )) + +(def: #export test + Test + (<| (_.covering /._) + (_.for [/.Versioning]) + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + + (do random.monad + [expected ..random + version (random.ascii/upper_alpha 3)] + (_.cover [/.format /.parser] + (|> expected + (/.format version) + (<xml>.run (/.parser version)) + (try\map (\ /.equivalence = expected)) + (try.default false)))) + ))) |