summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-21 06:25:43 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-21 06:25:43 -0700
commitf4fbc27f443b1a33148f88cc1643e0a5aa48671b (patch)
treeea9d8988ca1ea7023407a97ecd2b3c90298c0e1d
parente6b4c840ba4e0a9901a26d878ba710bf1d941269 (diff)
downloadtxr-f4fbc27f443b1a33148f88cc1643e0a5aa48671b.tar.gz
txr-f4fbc27f443b1a33148f88cc1643e0a5aa48671b.tar.bz2
txr-f4fbc27f443b1a33148f88cc1643e0a5aa48671b.zip
tests: add forgotten test for new expansion rule.
This was developed together with what became the May 12 commit 359642ecc2ac6aebdc33dd88de6a18b546b17a29; I just forgot to git add the file. * tests/011/macros-4.tl
-rw-r--r--tests/011/macros-4.tl11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/011/macros-4.tl b/tests/011/macros-4.tl
new file mode 100644
index 00000000..440dcd9e
--- /dev/null
+++ b/tests/011/macros-4.tl
@@ -0,0 +1,11 @@
+(load "../common")
+
+(defmacro xsqrt (:match :form f)
+ (((* @exp @exp)) exp)
+ (@else f))
+
+(defmacro xexpt (:match :form f)
+ ((@exp 2) ^(* ,exp ,exp))
+ (@else f))
+
+(test (expand '(xsqrt (xexpt x 2))) x)