aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/meta/compiler/reference/variable.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/meta/compiler/reference/variable.lux')
-rw-r--r--stdlib/source/test/lux/meta/compiler/reference/variable.lux45
1 files changed, 45 insertions, 0 deletions
diff --git a/stdlib/source/test/lux/meta/compiler/reference/variable.lux b/stdlib/source/test/lux/meta/compiler/reference/variable.lux
new file mode 100644
index 000000000..f2b219b86
--- /dev/null
+++ b/stdlib/source/test/lux/meta/compiler/reference/variable.lux
@@ -0,0 +1,45 @@
+(.require
+ [library
+ [lux (.except)
+ ["_" test (.only Test)]
+ [abstract
+ [monad (.only do)]
+ [\\specification
+ ["$[0]" equivalence]
+ ["$[0]" hash]]]
+ [data
+ ["[0]" text (.use "[1]#[0]" equivalence)]]
+ [math
+ ["[0]" random (.only Random)]]]]
+ [\\library
+ ["[0]" /]])
+
+(def .public random
+ (Random /.Variable)
+ (all random.or
+ random.nat
+ random.nat
+ ))
+
+(def .public test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Variable])
+ (do [! random.monad]
+ [register random.nat]
+ (all _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+ (_.for [/.hash]
+ ($hash.spec /.hash ..random))
+ (_.coverage [/.self]
+ (case (/.self)
+ (/.self) true
+ _ false))
+ (_.coverage [/.self?]
+ (/.self? (/.self)))
+ (_.for [/.Register]
+ (_.coverage [/.format]
+ (not (text#= (/.format {/.#Local register})
+ (/.format {/.#Foreign register})))))
+ ))))