aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec
diff options
context:
space:
mode:
authorEduardo Julian2020-12-10 22:29:32 -0400
committerEduardo Julian2020-12-10 22:29:32 -0400
commit9af671a34728b35c48bff2ba163c371dc5084946 (patch)
treeec35f32b8f0cabec702708e0e3cc4462b587c752 /stdlib/source/spec
parentd747aada2d6df6538d0a88d70169f3757aef50af (diff)
Render XML to text in an indented form for human readability.
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))))))))