aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/spec/lux/abstract/hash.lux22
-rw-r--r--stdlib/source/spec/lux/world/program.lux2
2 files changed, 24 insertions, 0 deletions
diff --git a/stdlib/source/spec/lux/abstract/hash.lux b/stdlib/source/spec/lux/abstract/hash.lux
new file mode 100644
index 000000000..a87846d1c
--- /dev/null
+++ b/stdlib/source/spec/lux/abstract/hash.lux
@@ -0,0 +1,22 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]]
+ [data
+ ["." bit ("#\." equivalence)]
+ [number
+ ["n" nat]]]
+ [math
+ ["." random (#+ Random)]]]
+ {1
+ ["." /]})
+
+(def: #export (spec (^open "\.") generator)
+ (All [a] (-> (/.Hash a) (Random a) Test))
+ (do random.monad
+ [parameter generator
+ subject generator]
+ (_.cover [/.Hash]
+ (bit\= (\= parameter subject)
+ (n.= (\hash parameter) (\hash subject))))))
diff --git a/stdlib/source/spec/lux/world/program.lux b/stdlib/source/spec/lux/world/program.lux
index 1d09908bf..f7f848ed3 100644
--- a/stdlib/source/spec/lux/world/program.lux
+++ b/stdlib/source/spec/lux/world/program.lux
@@ -23,9 +23,11 @@
[exit random.int]
(wrap (do promise.monad
[environment (\ subject environment [])
+ home (\ subject home [])
directory (\ subject directory [])]
(_.cover' [/.Program]
(and (not (dictionary.empty? environment))
(list.every? (|>> text.empty? not)
(dictionary.keys environment))
+ (not (text.empty? home))
(not (text.empty? directory))))))))