diff --git a/test/function/builtin/special/DEFINE_MACROTester.java b/test/function/builtin/special/DEFINE_MACROTester.java index ca6ef23..ef369cc 100644 --- a/test/function/builtin/special/DEFINE_MACROTester.java +++ b/test/function/builtin/special/DEFINE_MACROTester.java @@ -62,13 +62,13 @@ public class DEFINE_MACROTester { evaluateString("(define-macro f (x) (car x))"); assertSExpressionsMatch(parseString("quote"), evaluateString("(f '(1 2 3))")); } + @Test public void testDefineMacroAdd() { evaluateString("(define-macro f (x) (+ (eval x) 23))"); assertSExpressionsMatch(parseString("27"), evaluateString("(f (+ 2 2))")); } - @Test public void testDefineMacroSetVariable() { evaluateString("(define-macro f (x) (set x 23))"); @@ -83,6 +83,7 @@ public class DEFINE_MACROTester { evaluateString("(f x)"); assertSExpressionsMatch(parseString("0"), evaluateString("x")); } + @Test public void testDefineMacroAvoidVariableCaptureConvention() { evaluateString("(setf x 0)"); @@ -90,6 +91,7 @@ public class DEFINE_MACROTester { evaluateString("(f x)"); assertSExpressionsMatch(parseString("23"), evaluateString("x")); } + @Test public void redefineMacro_DisplaysWarning() { String input = "(define-macro myFunction () nil)";