2017-01-14 18:01:14 -05:00
|
|
|
package function.builtin.predicate;
|
2017-01-13 14:05:33 -05:00
|
|
|
|
|
|
|
import static testutil.TestUtilities.*;
|
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
import function.ArgumentValidator.*;
|
|
|
|
|
|
|
|
public class NULLTester {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testNilIsNull() {
|
|
|
|
String input = "(null ())";
|
|
|
|
|
|
|
|
assertSExpressionsMatch(evaluateString(input), parseString("T"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testListIsNotNull() {
|
|
|
|
String input = "(null '(1))";
|
|
|
|
|
|
|
|
assertSExpressionsMatch(evaluateString(input), parseString("NIL"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = TooFewArgumentsException.class)
|
|
|
|
public void testNullWithTooFewArguments() {
|
|
|
|
evaluateString("(null)");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = TooManyArgumentsException.class)
|
|
|
|
public void testNullWithTooManyArguments() {
|
|
|
|
evaluateString("(null 1 2)");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|