From 9af671a34728b35c48bff2ba163c371dc5084946 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 10 Dec 2020 22:29:32 -0400 Subject: Render XML to text in an indented form for human readability. --- stdlib/source/spec/lux/abstract/hash.lux | 22 ++++++++++++++++++++++ stdlib/source/spec/lux/world/program.lux | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 stdlib/source/spec/lux/abstract/hash.lux (limited to 'stdlib/source/spec') 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)))))))) -- cgit v1.2.3