transcendental-lisp/test/function/builtin/predicate/NULLTester.java

36 lines
791 B
Java
Raw Normal View History

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