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

33 lines
751 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.*;
public class LISTPTester {
@Test
public void testListpWithList_ReturnsT() {
2017-01-27 11:37:11 -05:00
assertT(evaluateString("(listp '(1))"));
}
@Test
public void testListWithNonList_ReturnsNil() {
2017-01-27 11:37:11 -05:00
assertNil(evaluateString("(listp 1)"));
}
@Test(expected = TooFewArgumentsException.class)
public void testListpWithTooFewArguments() {
evaluateString("(listp)");
}
@Test(expected = TooManyArgumentsException.class)
public void testListpWithTooManyArguments() {
evaluateString("(listp '() '())");
}
}