aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/macro/syntax/common
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/macro/syntax/common.lux17
-rw-r--r--stdlib/source/test/lux/macro/syntax/common/annotations.lux3
-rw-r--r--stdlib/source/test/lux/macro/syntax/common/type/variable.lux37
3 files changed, 43 insertions, 14 deletions
diff --git a/stdlib/source/test/lux/macro/syntax/common.lux b/stdlib/source/test/lux/macro/syntax/common.lux
index 429b7fc6e..2929417e3 100644
--- a/stdlib/source/test/lux/macro/syntax/common.lux
+++ b/stdlib/source/test/lux/macro/syntax/common.lux
@@ -33,7 +33,9 @@
["#." check]
["#." declaration]
["#." definition]
- ["#." export]])
+ ["#." export]
+ ["#." type #_
+ ["#/." variable]]])
(def: random_text
(Random Text)
@@ -46,18 +48,6 @@
(_.covering /writer._)
($_ _.and
(do {! random.monad}
- [size (\ ! map (|>> (n.% 3)) random.nat)
- expected (random.list size ..random_text)]
- (_.cover [/.Type_Var /reader.type_variables /writer.type_variables]
- (|> expected
- /writer.type_variables
- (<c>.run /reader.type_variables)
- (case> (#try.Success actual)
- (\ (list.equivalence text.equivalence) = expected actual)
-
- (#try.Failure error)
- false))))
- (do {! random.monad}
[expected (: (Random /.Typed_Input)
(random.and ///code.random
///code.random))]
@@ -77,4 +67,5 @@
/declaration.test
/definition.test
/export.test
+ /type/variable.test
)))
diff --git a/stdlib/source/test/lux/macro/syntax/common/annotations.lux b/stdlib/source/test/lux/macro/syntax/common/annotations.lux
index bc29a00f6..b1369ef48 100644
--- a/stdlib/source/test/lux/macro/syntax/common/annotations.lux
+++ b/stdlib/source/test/lux/macro/syntax/common/annotations.lux
@@ -49,4 +49,5 @@
false
(#try.Success actual)
- (\ /.equivalence = expected actual)))))))
+ (\ /.equivalence = expected actual))))
+ )))
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))))
+ )))