39 lines
897 B
Java
39 lines
897 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 LISTPTest extends SymbolAndFunctionCleaner {
|
|
|
|
@Test
|
|
public void listpWithList() {
|
|
assertT(evaluateString("(listp '(1))"));
|
|
}
|
|
|
|
@Test
|
|
public void listpWithListAndAlias() {
|
|
assertT(evaluateString("(list? '(1))"));
|
|
}
|
|
|
|
@Test
|
|
public void listpWithNonList() {
|
|
assertNil(evaluateString("(listp 1)"));
|
|
}
|
|
|
|
@Test(expected = TooFewArgumentsException.class)
|
|
public void listpWithTooFewArguments() {
|
|
evaluateString("(listp)");
|
|
}
|
|
|
|
@Test(expected = TooManyArgumentsException.class)
|
|
public void listpWithTooManyArguments() {
|
|
evaluateString("(listp '() '())");
|
|
}
|
|
|
|
}
|