fix(html): fix hashCode for triangle
The bug caused HTML class and CSS selector to have different IDs, breaking triangle rendering.
This commit was merged in pull request #20.
This commit is contained in:
48
src/test/java/ovh/gasser/newshapes/util/StreamableTest.java
Normal file
48
src/test/java/ovh/gasser/newshapes/util/StreamableTest.java
Normal file
@@ -0,0 +1,48 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user