From 893c76ad530ca0e81cd84602543c3114407f4592 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 9 Dec 2020 20:42:37 -0400 Subject: Added support for "Commons Clause" to Licentia. --- stdlib/source/spec/lux/world/program.lux | 31 +++++++++++++++++++++++++++++++ stdlib/source/spec/lux/world/shell.lux | 3 +-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 stdlib/source/spec/lux/world/program.lux (limited to 'stdlib/source/spec') 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 [ ] -- cgit v1.2.3