2017-01-14 18:01:14 -05:00
|
|
|
package function.builtin.predicate;
|
2017-01-13 14:05:33 -05:00
|
|
|
|
2017-01-27 11:37:11 -05:00
|
|
|
import static testutil.TestUtilities.evaluateString;
|
|
|
|
import static testutil.TypeAssertions.*;
|
2017-01-13 14:05:33 -05:00
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
import function.ArgumentValidator.*;
|
2017-07-19 15:23:15 -04:00
|
|
|
import testutil.SymbolAndFunctionCleaner;
|
2017-01-13 14:05:33 -05:00
|
|
|
|
2017-07-19 15:23:15 -04:00
|
|
|
public class NULLTest extends SymbolAndFunctionCleaner {
|
2017-01-13 14:05:33 -05:00
|
|
|
|
|
|
|
@Test
|
2017-01-27 11:37:11 -05:00
|
|
|
public void nilIsNull() {
|
|
|
|
assertT(evaluateString("(null ())"));
|
2017-01-13 14:05:33 -05:00
|
|
|
}
|
|
|
|
|
2017-03-07 13:15:40 -05:00
|
|
|
@Test
|
|
|
|
public void nilIsNullWithAlias() {
|
|
|
|
assertT(evaluateString("(null? ())"));
|
|
|
|
}
|
|
|
|
|
2017-01-13 14:05:33 -05:00
|
|
|
@Test
|
2017-01-27 11:37:11 -05:00
|
|
|
public void listIsNotNull() {
|
|
|
|
assertNil(evaluateString("(null '(1))"));
|
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)");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|