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

38 lines
824 B
Java

package function.builtin.predicate;
import static testutil.TestUtilities.evaluateString;
import static testutil.TypeAssertions.*;
import org.junit.Test;
import function.ArgumentValidator.*;
public class LISTPTester {
@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 '() '())");
}
}