Formatted a source file

This commit is contained in:
Mike Cifelli 2017-02-25 19:12:34 -05:00
parent 78c7bf4d9c
commit 1fed0433e5
1 changed files with 3 additions and 1 deletions

View File

@ -62,13 +62,13 @@ public class DEFINE_MACROTester {
evaluateString("(define-macro f (x) (car x))"); evaluateString("(define-macro f (x) (car x))");
assertSExpressionsMatch(parseString("quote"), evaluateString("(f '(1 2 3))")); assertSExpressionsMatch(parseString("quote"), evaluateString("(f '(1 2 3))"));
} }
@Test @Test
public void testDefineMacroAdd() { public void testDefineMacroAdd() {
evaluateString("(define-macro f (x) (+ (eval x) 23))"); evaluateString("(define-macro f (x) (+ (eval x) 23))");
assertSExpressionsMatch(parseString("27"), evaluateString("(f (+ 2 2))")); assertSExpressionsMatch(parseString("27"), evaluateString("(f (+ 2 2))"));
} }
@Test @Test
public void testDefineMacroSetVariable() { public void testDefineMacroSetVariable() {
evaluateString("(define-macro f (x) (set x 23))"); evaluateString("(define-macro f (x) (set x 23))");
@ -83,6 +83,7 @@ public class DEFINE_MACROTester {
evaluateString("(f x)"); evaluateString("(f x)");
assertSExpressionsMatch(parseString("0"), evaluateString("x")); assertSExpressionsMatch(parseString("0"), evaluateString("x"));
} }
@Test @Test
public void testDefineMacroAvoidVariableCaptureConvention() { public void testDefineMacroAvoidVariableCaptureConvention() {
evaluateString("(setf x 0)"); evaluateString("(setf x 0)");
@ -90,6 +91,7 @@ public class DEFINE_MACROTester {
evaluateString("(f x)"); evaluateString("(f x)");
assertSExpressionsMatch(parseString("23"), evaluateString("x")); assertSExpressionsMatch(parseString("23"), evaluateString("x"));
} }
@Test @Test
public void redefineMacro_DisplaysWarning() { public void redefineMacro_DisplaysWarning() {
String input = "(define-macro myFunction () nil)"; String input = "(define-macro myFunction () nil)";