aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/spec')
-rw-r--r--stdlib/source/spec/lux/world/program.lux31
-rw-r--r--stdlib/source/spec/lux/world/shell.lux3
2 files changed, 32 insertions, 2 deletions
diff --git a/stdlib/source/spec/lux/world/program.lux b/stdlib/source/spec/lux/world/program.lux
new file mode 100644
index 000000000..1d09908bf
--- /dev/null
+++ b/stdlib/source/spec/lux/world/program.lux
@@ -0,0 +1,31 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]]
+ [control
+ ["." try]
+ [concurrency
+ ["." promise (#+ Promise)]]]
+ [data
+ ["." text]
+ [collection
+ ["." dictionary]
+ ["." list]]]
+ [math
+ ["." random]]]
+ {1
+ ["." /]})
+
+(def: #export (spec subject)
+ (-> (/.Program Promise) Test)
+ (do random.monad
+ [exit random.int]
+ (wrap (do promise.monad
+ [environment (\ subject environment [])
+ directory (\ subject directory [])]
+ (_.cover' [/.Program]
+ (and (not (dictionary.empty? environment))
+ (list.every? (|>> text.empty? not)
+ (dictionary.keys environment))
+ (not (text.empty? directory))))))))
diff --git a/stdlib/source/spec/lux/world/shell.lux b/stdlib/source/spec/lux/world/shell.lux
index 27ccf321c..b6aa282d4 100644
--- a/stdlib/source/spec/lux/world/shell.lux
+++ b/stdlib/source/spec/lux/world/shell.lux
@@ -10,7 +10,7 @@
[concurrency
["." promise (#+ Promise)]]
[parser
- ["." environment]]]
+ ["." environment (#+ Environment)]]]
[data
["." product]
["." text ("#\." equivalence)
@@ -23,7 +23,6 @@
{1
["." /
[//
- [environment (#+ Environment)]
[file (#+ Path)]]]})
(template [<name> <command> <type> <prep>]