aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/macro/syntax/common/type/variable.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/macro/syntax/common/type/variable.lux')
-rw-r--r--stdlib/source/test/lux/macro/syntax/common/type/variable.lux37
1 files changed, 37 insertions, 0 deletions
diff --git a/stdlib/source/test/lux/macro/syntax/common/type/variable.lux b/stdlib/source/test/lux/macro/syntax/common/type/variable.lux
new file mode 100644
index 000000000..4701f5aef
--- /dev/null
+++ b/stdlib/source/test/lux/macro/syntax/common/type/variable.lux
@@ -0,0 +1,37 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]
+ {[0 #spec]
+ [/
+ ["$." equivalence]]}]
+ [control
+ ["." try ("#\." functor)]
+ [parser
+ ["<.>" code]]]
+ [math
+ ["." random (#+ Random)]]]
+ {1
+ ["." /]})
+
+(def: #export random
+ (Random /.Variable)
+ (random.ascii/alpha 10))
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Variable])
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+
+ (do random.monad
+ [expected ..random]
+ (_.cover [/.format /.parser]
+ (|> (list (/.format expected))
+ (<code>.run /.parser)
+ (try\map (\ /.equivalence = expected))
+ (try.default false))))
+ )))