From 8aac0c573c29d2829242d66539a9e027d03ff8ec Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 11 Jan 2021 02:05:30 -0400 Subject: Encapsulate JS definitions produced by the JS compiler in a local scope to avoid interacting with the global scope. --- stdlib/source/test/aedifex/artifact/versioning.lux | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 stdlib/source/test/aedifex/artifact/versioning.lux (limited to 'stdlib/source/test/aedifex/artifact/versioning.lux') 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) + (.run (/.parser version)) + (try\map (\ /.equivalence = expected)) + (try.default false)))) + ))) -- cgit v1.2.3