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

39 lines
897 B
Java
Raw Normal View History

package function.builtin.predicate;
2017-01-27 11:37:11 -05:00
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() {
2017-01-27 11:37:11 -05:00
assertT(evaluateString("(listp '(1))"));
}
2017-03-07 13:15:40 -05:00
@Test
public void listpWithListAndAlias() {
assertT(evaluateString("(list? '(1))"));
}
@Test
public void listpWithNonList() {
2017-01-27 11:37:11 -05:00
assertNil(evaluateString("(listp 1)"));
}
@Test(expected = TooFewArgumentsException.class)
public void listpWithTooFewArguments() {
evaluateString("(listp)");
}
@Test(expected = TooManyArgumentsException.class)
public void listpWithTooManyArguments() {
evaluateString("(listp '() '())");
}
}