mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-03 22:36:10 +00:00
add ColumnTest#testForRangesIndividual
This commit is contained in:
@@ -11,6 +11,8 @@ import org.junit.jupiter.api.Test;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@@ -43,6 +45,15 @@ public class ColumnTest {
|
||||
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> {
|
||||
private final int min;
|
||||
private final int max;
|
||||
|
||||
Reference in New Issue
Block a user