aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec
diff options
context:
space:
mode:
authorEduardo Julian2020-12-09 20:42:37 -0400
committerEduardo Julian2020-12-09 20:42:37 -0400
commit893c76ad530ca0e81cd84602543c3114407f4592 (patch)
tree6d14f38c7b9f5b37809615d0dca7545b36405525 /stdlib/source/spec
parent8df63aae42c40ac0413ccfacc3b2e8eb72e00a15 (diff)
Added support for "Commons Clause" to Licentia.
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>]