summaryrefslogtreecommitdiff
path: root/test-suite/tests/elisp-compiler.test
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2009-07-16 15:23:38 +0200
committerDaniel Kraft <d@domob.eu>2009-07-16 15:23:38 +0200
commit74c009dadc1e8f580727d2c85bf72ec90e82d15a (patch)
tree8c75d6c4dc1751149716772b5be4171e2df9b2d7 /test-suite/tests/elisp-compiler.test
parentb6b9d59604aa320cf2bdb7d4934315febab3f6dc (diff)
downloadguile-74c009dadc1e8f580727d2c85bf72ec90e82d15a.tar.gz
Implemented macros in elisp compiler.
* module/language/elisp/README: Document it. * module/language/elisp/compile-tree-il.scm: Implement defmacro and expansion. * module/language/elisp/runtime/macro-slot.scm: New module to keep definitions. * test-suite/Makefile.am: Add elisp-compiler.test to list of tests. * test-suite/tests/elisp-compiler.test: Basic macro tests.
Diffstat (limited to 'test-suite/tests/elisp-compiler.test')
-rw-r--r--test-suite/tests/elisp-compiler.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/test-suite/tests/elisp-compiler.test b/test-suite/tests/elisp-compiler.test
index fdb677195..677f14dc0 100644
--- a/test-suite/tests/elisp-compiler.test
+++ b/test-suite/tests/elisp-compiler.test
@@ -211,6 +211,19 @@
(zerop a)))))
+; Macros.
+; =======
+
+(with-test-prefix/compile "Macros"
+
+ (pass-if-equal "defmacro value" 'magic-number
+ (defmacro magic-number () 42))
+
+ (pass-if-equal "macro expansion" 1
+ (progn (defmacro take-first (a b) a)
+ (take-first 1 (/ 1 0)))))
+
+
; Test the built-ins.
; ===================