aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/world
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/test/lux/world
parent8df63aae42c40ac0413ccfacc3b2e8eb72e00a15 (diff)
Added support for "Commons Clause" to Licentia.
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r--stdlib/source/test/lux/world/environment.lux31
-rw-r--r--stdlib/source/test/lux/world/program.lux39
-rw-r--r--stdlib/source/test/lux/world/shell.lux3
3 files changed, 40 insertions, 33 deletions
diff --git a/stdlib/source/test/lux/world/environment.lux b/stdlib/source/test/lux/world/environment.lux
deleted file mode 100644
index 28bcfc377..000000000
--- a/stdlib/source/test/lux/world/environment.lux
+++ /dev/null
@@ -1,31 +0,0 @@
-(.module:
- [lux #*
- ["_" test (#+ Test)]
- [abstract
- [monad (#+ do)]]
- [control
- [concurrency
- ["." promise]]]
- [data
- ["." text]
- [collection
- ["." dictionary]
- ["." list]]]
- [math
- ["." random]]]
- {1
- ["." /]})
-
-(def: #export test
- Test
- (<| (_.covering /._)
- (_.with-cover [/.Environment /.Property])
- (do random.monad
- [_ (wrap [])]
- (wrap (do promise.monad
- [environment (promise.future /.read)]
- (_.cover' [/.read]
- (and (not (dictionary.empty? environment))
- (|> environment
- dictionary.keys
- (list.every? (|>> text.empty? not))))))))))
diff --git a/stdlib/source/test/lux/world/program.lux b/stdlib/source/test/lux/world/program.lux
new file mode 100644
index 000000000..5dcf6270a
--- /dev/null
+++ b/stdlib/source/test/lux/world/program.lux
@@ -0,0 +1,39 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]]
+ [control
+ [parser
+ [environment (#+ Environment)]]]
+ [data
+ ["." text]]
+ [math
+ ["." random (#+ Random)]]]
+ {1
+ ["." /
+ [//
+ [file (#+ Path)]]]}
+ {[1 #spec]
+ ["$." /]})
+
+(def: environment
+ (Random Environment)
+ (random.dictionary text.hash 5
+ (random.ascii/alpha 5)
+ (random.ascii/alpha 5)))
+
+(def: directory
+ (Random Path)
+ (random.ascii/alpha 5))
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (do random.monad
+ [environment ..environment
+ directory ..directory]
+ ($_ _.and
+ (_.with-cover [/.mock /.async]
+ ($/.spec (/.async (/.mock environment directory))))
+ ))))
diff --git a/stdlib/source/test/lux/world/shell.lux b/stdlib/source/test/lux/world/shell.lux
index e9d844141..cf349e225 100644
--- a/stdlib/source/test/lux/world/shell.lux
+++ b/stdlib/source/test/lux/world/shell.lux
@@ -13,7 +13,7 @@
[security
["!" capability]]
[parser
- ["." environment]]]
+ ["." environment (#+ Environment)]]]
[data
["." text ("#\." equivalence)]
[number
@@ -26,7 +26,6 @@
{1
["." /
[//
- [environment (#+ Environment)]
[file (#+ Path)]]]}
{[1 #spec]
["$." /]})