mirror of
https://github.com/processing/processing4.git
synced 2026-03-16 01:17:39 +01:00
address issue 515
This commit is contained in:
32
core/test/processing/core/PShapeSVGTest.java
Normal file
32
core/test/processing/core/PShapeSVGTest.java
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user