aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/meta/compiler/reference/variable.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-07-06 12:05:43 -0400
committerEduardo Julian2022-07-06 12:05:43 -0400
commit0c32c7f03ad1f8f0db54b623dc407713bbf8cacd (patch)
tree59736e9e5f9f8cc94c0b46872f9e78575e45d8da /stdlib/source/test/lux/meta/compiler/reference/variable.lux
parent9a9b2493a8eda60f08809b4cb1e5bc49c5c3600c (diff)
Moved compiler machinery under lux/meta.
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})))))
+ ))))