diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/world/environment.lux | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/stdlib/source/test/lux/world/environment.lux b/stdlib/source/test/lux/world/environment.lux index 8c2484e7b..c6b2e95e2 100644 --- a/stdlib/source/test/lux/world/environment.lux +++ b/stdlib/source/test/lux/world/environment.lux @@ -9,7 +9,9 @@ ["[0]" io] ["[0]" maybe (.use "[1]#[0]" functor)] ["[0]" try] - ["[0]" exception]] + ["[0]" exception] + [concurrency + ["[0]" async (.only Async)]]] [data ["[0]" text (.use "[1]#[0]" equivalence)] [collection @@ -20,14 +22,27 @@ [number ["n" nat]]] [test - ["_" property (.only Test)]]]] + ["_" property (.only Test)] + ["[0]" unit]]]] ["[0]" \\parser (.only Environment)] [\\library ["[0]" / (.only) [// - [file (.only Path)]]]] - [\\specification - ["$[0]" /]]) + [file (.only Path)]]]]) + +(def .public (spec subject) + (-> (/.Environment Async) + Test) + (do random.monad + [exit random.int] + (in (do [! async.monad] + [environment (/.environment ! subject)] + (unit.coverage [/.Environment] + (and (not (dictionary.empty? environment)) + (list.every? (|>> text.empty? not) + (dictionary.keys environment)) + (not (text.empty? (of subject home))) + (not (text.empty? (of subject directory))))))))) (def \\parser Test @@ -84,7 +99,7 @@ unknown (random.alphabetic 1)] (all _.and (_.for [/.mock /.async] - ($/.spec (/.async (/.mock environment home directory)))) + (..spec (/.async (/.mock environment home directory)))) (_.coverage [/.environment] (let [it (/.mock environment home directory)] (io.run! |