39 lines
883 B
Java
39 lines
883 B
Java
package function.builtin.predicate;
|
|
|
|
import static testutil.TestUtilities.evaluateString;
|
|
import static testutil.TypeAssertions.*;
|
|
|
|
import org.junit.Test;
|
|
|
|
import function.ArgumentValidator.*;
|
|
import testutil.SymbolAndFunctionCleaner;
|
|
|
|
public class NULLTest extends SymbolAndFunctionCleaner {
|
|
|
|
@Test
|
|
public void nilIsNull() {
|
|
assertT(evaluateString("(null ())"));
|
|
}
|
|
|
|
@Test
|
|
public void nilIsNullWithAlias() {
|
|
assertT(evaluateString("(null? ())"));
|
|
}
|
|
|
|
@Test
|
|
public void listIsNotNull() {
|
|
assertNil(evaluateString("(null '(1))"));
|
|
}
|
|
|
|
@Test(expected = TooFewArgumentsException.class)
|
|
public void testNullWithTooFewArguments() {
|
|
evaluateString("(null)");
|
|
}
|
|
|
|
@Test(expected = TooManyArgumentsException.class)
|
|
public void testNullWithTooManyArguments() {
|
|
evaluateString("(null 1 2)");
|
|
}
|
|
|
|
}
|