2017-01-14 18:01:14 -05:00
|
|
|
package function.builtin.predicate;
|
2017-01-13 12:52:05 -05:00
|
|
|
|
2017-01-27 11:37:11 -05:00
|
|
|
import static testutil.TestUtilities.evaluateString;
|
|
|
|
import static testutil.TypeAssertions.*;
|
2017-01-13 12:52:05 -05:00
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
import function.ArgumentValidator.*;
|
|
|
|
|
2017-03-15 13:37:39 -04:00
|
|
|
public class LISTPTest {
|
2017-01-13 12:52:05 -05:00
|
|
|
|
|
|
|
@Test
|
2017-02-28 11:54:19 -05:00
|
|
|
public void listpWithList() {
|
2017-01-27 11:37:11 -05:00
|
|
|
assertT(evaluateString("(listp '(1))"));
|
2017-01-13 12:52:05 -05:00
|
|
|
}
|
|
|
|
|
2017-03-07 13:15:40 -05:00
|
|
|
@Test
|
|
|
|
public void listpWithListAndAlias() {
|
|
|
|
assertT(evaluateString("(list? '(1))"));
|
|
|
|
}
|
|
|
|
|
2017-01-13 12:52:05 -05:00
|
|
|
@Test
|
2017-02-28 11:54:19 -05:00
|
|
|
public void listpWithNonList() {
|
2017-01-27 11:37:11 -05:00
|
|
|
assertNil(evaluateString("(listp 1)"));
|
2017-01-13 12:52:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = TooFewArgumentsException.class)
|
2017-02-28 11:54:19 -05:00
|
|
|
public void listpWithTooFewArguments() {
|
2017-01-13 14:05:33 -05:00
|
|
|
evaluateString("(listp)");
|
2017-01-13 12:52:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = TooManyArgumentsException.class)
|
2017-02-28 11:54:19 -05:00
|
|
|
public void listpWithTooManyArguments() {
|
2017-01-13 14:05:33 -05:00
|
|
|
evaluateString("(listp '() '())");
|
2017-01-13 12:52:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|