aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/artifact
diff options
context:
space:
mode:
authorEduardo Julian2021-01-11 02:05:30 -0400
committerEduardo Julian2021-01-11 02:05:30 -0400
commit8aac0c573c29d2829242d66539a9e027d03ff8ec (patch)
tree5b4b37d33b90ff24b3d9d019e31770d6d0b8dc9d /stdlib/source/test/aedifex/artifact
parent706ce9e4916b65c4df5101bd3cc1b4da3b2057af (diff)
Encapsulate JS definitions produced by the JS compiler in a local scope to avoid interacting with the global scope.
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/aedifex/artifact.lux2
-rw-r--r--stdlib/source/test/aedifex/artifact/versioning.lux43
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))))
+ )))