aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/macro/local.lux37
1 files changed, 37 insertions, 0 deletions
diff --git a/stdlib/source/test/lux/macro/local.lux b/stdlib/source/test/lux/macro/local.lux
index de1073f55..bb03574a1 100644
--- a/stdlib/source/test/lux/macro/local.lux
+++ b/stdlib/source/test/lux/macro/local.lux
@@ -27,6 +27,12 @@
[\\library
["[0]" /]])
+(/.let [!pow/2 (template (_ <scalar>)
+ [(n.* <scalar> <scalar>)])]
+ (def: pow/2
+ (-> Nat Nat)
+ (|>> !pow/2)))
+
(def: macro_error
(syntax (_ [macro <code>.any])
(function (_ compiler)
@@ -90,4 +96,35 @@
(<| ..macro_error
(..with ["" "actual"] expected #1)
(n.= expected (..actual)))))
+ (do !
+ [scalar random.nat]
+ (_.coverage [/.let]
+ (let [can_use_with_statements!
+ (n.= (all n.* scalar scalar)
+ (..pow/2 scalar))]
+ (and can_use_with_statements!
+ (/.let [pow/3 (template (_ <scalar>)
+ [(all n.* <scalar> <scalar> <scalar>)])
+ pow/9 (template (_ <scalar>)
+ [(pow/3 (pow/3 <scalar>))])]
+ (let [can_use_with_expressions!
+ (n.= (all n.* scalar scalar scalar)
+ (pow/3 scalar))
+
+ can_refer!
+ (n.= (all n.*
+ scalar scalar scalar
+ scalar scalar scalar
+ scalar scalar scalar)
+ (pow/9 scalar))
+
+ can_shadow!
+ (let [pow/3 (function (_ scalar)
+ (all n.+ scalar scalar scalar))]
+ (n.= (all n.+ scalar scalar scalar)
+ (pow/3 scalar)))]
+ (and can_use_with_expressions!
+ can_refer!
+ can_shadow!)))
+ ))))
))))