Increase test coverage

This commit is contained in:
Mike Cifelli 2018-03-15 18:48:33 -04:00
parent 76cd2b919a
commit 1829fea754
1 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.DottedArgumentListException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.EVAL.UndefinedFunctionException;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.Symbol;
@ -132,6 +133,11 @@ public class LAMBDATest extends SymbolAndFunctionCleaner {
evaluateString("((lambda (x y) x) 1 2 3)");
}
@Test(expected = UndefinedFunctionException.class)
public void badAnonymousFunctionCall() {
evaluateString("((bad-lambda (x y) x) 1 2 3)");
}
@Test
public void lexicalClosure() {
evaluateString("(setq increment-count (let ((counter 0)) (lambda () (setq counter (+ 1 counter)))))");