aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/artifact/versioning.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/aedifex/artifact/versioning.lux')
-rw-r--r--stdlib/source/test/aedifex/artifact/versioning.lux43
1 files changed, 43 insertions, 0 deletions
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))))
+ )))