58 lines
1.2 KiB
Java
58 lines
1.2 KiB
Java
package function.builtin.predicate;
|
|
|
|
import static testutil.TestUtilities.evaluateString;
|
|
import static testutil.TypeAssertions.*;
|
|
|
|
import org.junit.Test;
|
|
|
|
import function.ArgumentValidator.*;
|
|
|
|
public class NUMERIC_LESSTest {
|
|
|
|
@Test
|
|
public void lessThanWithOneNumber_ReturnsT() {
|
|
String input = "(< 1)";
|
|
|
|
assertT(evaluateString(input));
|
|
}
|
|
|
|
@Test
|
|
public void lessThanWithTwoNumbers_ReturnsNil() {
|
|
String input = "(< 2 1)";
|
|
|
|
assertNil(evaluateString(input));
|
|
}
|
|
|
|
@Test
|
|
public void lessThanWithTwoNumbers_ReturnsT() {
|
|
String input = "(< 2 3)";
|
|
|
|
assertT(evaluateString(input));
|
|
}
|
|
|
|
@Test
|
|
public void lessThanWithManyNumbers_ReturnsNil() {
|
|
String input = "(< 4 3 2 5 1)";
|
|
|
|
assertNil(evaluateString(input));
|
|
}
|
|
|
|
@Test
|
|
public void lessThanWithManyNumbers_ReturnsT() {
|
|
String input = "(< 0 1 2 3 4)";
|
|
|
|
assertT(evaluateString(input));
|
|
}
|
|
|
|
@Test(expected = BadArgumentTypeException.class)
|
|
public void lessThanWithNonNumbers() {
|
|
evaluateString("(< '(1) '(2))");
|
|
}
|
|
|
|
@Test(expected = TooFewArgumentsException.class)
|
|
public void lessThanWithTooFewArguments() {
|
|
evaluateString("(<)");
|
|
}
|
|
|
|
}
|