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:
2026-03-27 15:06:46 +01:00
parent da70c9f568
commit ba37b199de
4 changed files with 370 additions and 2 deletions

View 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());
}
}