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 ())";
|
|
|
|
|
2017-01-27 10:51:25 -05:00
|
|
|
assertSExpressionsMatch(parseString("T"), evaluateString(input));
|
2017-01-13 14:05:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testListIsNotNull() {
|
|
|
|
String input = "(null '(1))";
|
|
|
|
|
2017-01-27 10:51:25 -05:00
|
|
|
assertSExpressionsMatch(parseString("NIL"), evaluateString(input));
|
2017-01-13 14:05:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = TooFewArgumentsException.class)
|
|
|
|
public void testNullWithTooFewArguments() {
|
|
|
|
evaluateString("(null)");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = TooManyArgumentsException.class)
|
|
|
|
public void testNullWithTooManyArguments() {
|
|
|
|
evaluateString("(null 1 2)");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|