Increase test coverage
This commit is contained in:
parent
76cd2b919a
commit
1829fea754
|
@ -15,6 +15,7 @@ import function.ArgumentValidator.BadArgumentTypeException;
|
||||||
import function.ArgumentValidator.DottedArgumentListException;
|
import function.ArgumentValidator.DottedArgumentListException;
|
||||||
import function.ArgumentValidator.TooFewArgumentsException;
|
import function.ArgumentValidator.TooFewArgumentsException;
|
||||||
import function.ArgumentValidator.TooManyArgumentsException;
|
import function.ArgumentValidator.TooManyArgumentsException;
|
||||||
|
import function.builtin.EVAL.UndefinedFunctionException;
|
||||||
import sexpression.Cons;
|
import sexpression.Cons;
|
||||||
import sexpression.LispNumber;
|
import sexpression.LispNumber;
|
||||||
import sexpression.Symbol;
|
import sexpression.Symbol;
|
||||||
|
@ -132,6 +133,11 @@ public class LAMBDATest extends SymbolAndFunctionCleaner {
|
||||||
evaluateString("((lambda (x y) x) 1 2 3)");
|
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
|
@Test
|
||||||
public void lexicalClosure() {
|
public void lexicalClosure() {
|
||||||
evaluateString("(setq increment-count (let ((counter 0)) (lambda () (setq counter (+ 1 counter)))))");
|
evaluateString("(setq increment-count (let ((counter 0)) (lambda () (setq counter (+ 1 counter)))))");
|
||||||
|
|
Loading…
Reference in New Issue