mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 05:50:08 +00:00
add ColumnTest#testForRangesIndividual
This commit is contained in:
1 parent
d95e998e5d
commit
7ce8dfbc65
1 file changed
+11
@@ -11,6 +11,8 @@ import org.junit.jupiter.api.Test;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
@@ -43,6 +45,15 @@ public class ColumnTest {
|
|||||||
list);
|
list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testForRangesIndividual() {
|
||||||
|
List<Pair<Pair<Integer, Integer>, Integer>> list = new ArrayList<>();
|
||||||
|
|
||||||
|
returnY.forRanges((min, max, p) -> list.add(Pair.of(Pair.of(min, max), p)));
|
||||||
|
|
||||||
|
assertEquals(IntStream.range(-10, 11).mapToObj(i -> Pair.of(Pair.of(i, i + 1), i)).collect(Collectors.toList()),
|
||||||
|
list);
|
||||||
|
}
|
||||||
static class ColumnImpl<T> implements Column<T> {
|
static class ColumnImpl<T> implements Column<T> {
|
||||||
private final int min;
|
private final int min;
|
||||||
private final int max;
|
private final int max;
|
||||||
|
|||||||
Reference in new issue
Block a user