The bug caused HTML class and CSS selector to have different IDs, breaking triangle rendering.
49 lines
1.2 KiB
Java
49 lines
1.2 KiB
Java
package ovh.gasser.newshapes.util;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.stream.Stream;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
class StreamableTest {
|
|
|
|
private static class TestStreamable implements Streamable<String> {
|
|
private final List<String> elements;
|
|
|
|
TestStreamable(List<String> elements) {
|
|
this.elements = new ArrayList<>(elements);
|
|
}
|
|
|
|
@Override
|
|
public java.util.Iterator<String> iterator() {
|
|
return elements.iterator();
|
|
}
|
|
}
|
|
|
|
@Test
|
|
void testStreamReturnsStreamOfElements() {
|
|
List<String> testData = Arrays.asList("a", "b", "c");
|
|
Streamable<String> streamable = new TestStreamable(testData);
|
|
|
|
Stream<String> result = streamable.stream();
|
|
|
|
assertNotNull(result);
|
|
assertEquals(testData, result.toList());
|
|
}
|
|
|
|
@Test
|
|
void testStreamEmptyCollection() {
|
|
List<String> emptyData = new ArrayList<>();
|
|
Streamable<String> streamable = new TestStreamable(emptyData);
|
|
|
|
Stream<String> result = streamable.stream();
|
|
|
|
assertNotNull(result);
|
|
assertTrue(result.toList().isEmpty());
|
|
}
|
|
}
|