From eea741e9b4a47ae09832311d6d61f0bd6024f673 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 31 Oct 2020 02:59:48 -0400 Subject: Easy to use Rev constants. --- stdlib/source/test/aedifex/artifact.lux | 20 +++++++++++++++++- stdlib/source/test/aedifex/local.lux | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 stdlib/source/test/aedifex/local.lux (limited to 'stdlib/source/test/aedifex') diff --git a/stdlib/source/test/aedifex/artifact.lux b/stdlib/source/test/aedifex/artifact.lux index 376f26717..9a4607306 100644 --- a/stdlib/source/test/aedifex/artifact.lux +++ b/stdlib/source/test/aedifex/artifact.lux @@ -7,8 +7,17 @@ {[0 #spec] [/ ["$." equivalence]]}] + [control + [concurrency + [promise (#+ Promise)]]] + [data + ["." text ("#@." equivalence)]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)]] + [world + ["." file] + [net + ["." uri]]]] ["." / #_ ["#." type] ["#." extension]] @@ -31,6 +40,15 @@ (_.with-cover [/.equivalence] ($equivalence.spec /.equivalence ..random)) + (do random.monad + [sample ..random + #let [fs (: (file.System Promise) + (file.mock (:: file.default separator)))]] + (_.cover [/.uri /.path] + (|> (/.path fs sample) + (text.replace-all uri.separator (:: fs separator)) + (text@= (/.uri sample))))) + /type.test /extension.test )))) diff --git a/stdlib/source/test/aedifex/local.lux b/stdlib/source/test/aedifex/local.lux new file mode 100644 index 000000000..a883f565e --- /dev/null +++ b/stdlib/source/test/aedifex/local.lux @@ -0,0 +1,36 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)]] + [control + [concurrency + [promise (#+ Promise)]]] + [data + ["." text]] + [math + ["." random (#+ Random)]] + [world + ["." file]]] + [// + ["@." artifact]] + {#program + ["." / + ["/#" // #_ + ["#." artifact]]]}) + +(def: #export test + Test + (<| (_.covering /._) + (do {@ random.monad} + [sample @artifact.random + #let [fs (: (file.System Promise) + (file.mock (:: file.default separator)))]] + ($_ _.and + (_.cover [/.repository /.path] + (let [path (/.path fs sample)] + (and (text.starts-with? (/.repository fs) + path) + (text.ends-with? (//artifact.path fs sample) + path)))) + )))) -- cgit v1.2.3