address issue 515

This commit is contained in:
Brian Sapozhnikov
2023-01-29 21:22:54 -05:00
parent 9a5caf3905
commit 080cb3de75
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package processing.core;
import org.junit.Assert;
import org.junit.Test;
import processing.data.XML;
import processing.core.PImage;
import java.awt.*;
public class PShapeSVGTest {
private static final String TEST_CONTENT = "<svg><g><path d=\"L 0,3.1.4.1\"/></g></svg>";
@Test
public void testDecimals() {
try {
XML xml = XML.parse(TEST_CONTENT);
PShapeSVG shape = new PShapeSVG(xml);
PShape[] children = shape.getChildren();
Assert.assertEquals(1, children.length);
PShape[] grandchildren = children[0].getChildren();
Assert.assertEquals(1, grandchildren.length);
Assert.assertEquals(0, grandchildren[0].getChildCount());
Assert.assertEquals(2, grandchildren[0].getVertexCount());
}
catch (Exception e) {
Assert.fail("Encountered exception " + e);
}
}
}