From 664e02d1b5e5aa479869c4e17ec4128f5cfd04e2 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 29 Jun 2022 03:15:23 -0400 Subject: New "parser" hierarchy. [Part 6] --- .../source/specification/lux/world/environment.lux | 32 ++++++++++++++++++++++ stdlib/source/specification/lux/world/program.lux | 32 ---------------------- stdlib/source/specification/lux/world/shell.lux | 8 +++--- 3 files changed, 36 insertions(+), 36 deletions(-) create mode 100644 stdlib/source/specification/lux/world/environment.lux delete mode 100644 stdlib/source/specification/lux/world/program.lux (limited to 'stdlib/source/specification') diff --git a/stdlib/source/specification/lux/world/environment.lux b/stdlib/source/specification/lux/world/environment.lux new file mode 100644 index 000000000..2163fc2e1 --- /dev/null +++ b/stdlib/source/specification/lux/world/environment.lux @@ -0,0 +1,32 @@ +(.require + [library + [lux (.except) + ["_" test (.only Test)] + [abstract + [monad (.only do)]] + [control + ["[0]" try] + [concurrency + ["[0]" async (.only Async)]]] + [data + ["[0]" text] + [collection + ["[0]" dictionary] + ["[0]" list]]] + [math + ["[0]" random]]]] + [\\library + ["[0]" /]]) + +(def .public (spec subject) + (-> (/.Environment Async) Test) + (do random.monad + [exit random.int] + (in (do [! async.monad] + [environment (/.environment ! subject)] + (_.coverage' [/.Environment] + (and (not (dictionary.empty? environment)) + (list.every? (|>> text.empty? not) + (dictionary.keys environment)) + (not (text.empty? (at subject home))) + (not (text.empty? (at subject directory))))))))) diff --git a/stdlib/source/specification/lux/world/program.lux b/stdlib/source/specification/lux/world/program.lux deleted file mode 100644 index b941158b4..000000000 --- a/stdlib/source/specification/lux/world/program.lux +++ /dev/null @@ -1,32 +0,0 @@ -(.require - [library - [lux (.except) - ["_" test (.only Test)] - [abstract - [monad (.only do)]] - [control - ["[0]" try] - [concurrency - ["[0]" async (.only Async)]]] - [data - ["[0]" text] - [collection - ["[0]" dictionary] - ["[0]" list]]] - [math - ["[0]" random]]]] - [\\library - ["[0]" /]]) - -(def .public (spec subject) - (-> (/.Program Async) Test) - (do random.monad - [exit random.int] - (in (do [! async.monad] - [environment (/.environment ! subject)] - (_.coverage' [/.Program] - (and (not (dictionary.empty? environment)) - (list.every? (|>> text.empty? not) - (dictionary.keys environment)) - (not (text.empty? (at subject home))) - (not (text.empty? (at subject directory))))))))) diff --git a/stdlib/source/specification/lux/world/shell.lux b/stdlib/source/specification/lux/world/shell.lux index 2ac53794c..ddf544c55 100644 --- a/stdlib/source/specification/lux/world/shell.lux +++ b/stdlib/source/specification/lux/world/shell.lux @@ -7,9 +7,7 @@ [control ["[0]" try (.use "[1]#[0]" functor)] [concurrency - ["[0]" async (.only Async) (.use "[1]#[0]" monad)]] - [parser - ["[0]" environment (.only Environment)]]] + ["[0]" async (.only Async) (.use "[1]#[0]" monad)]]] [data ["[0]" product] ["[0]" text (.use "[1]#[0]" equivalence) @@ -22,7 +20,9 @@ [\\library ["[0]" / (.only) [// - [file (.only Path)]]]]) + [file (.only Path)] + ["[0]" environment + ["[1]" \\parser (.only Environment)]]]]]) (with_template [ ] [(def -- cgit v1.2.3