Skip to content

Commit c8dc9fe

Browse files
committed
Add some new SVG tests.
DEVSIX-2044, DEVSIX-2333
1 parent e99dbe9 commit c8dc9fe

File tree

7 files changed

+58
-1
lines changed

7 files changed

+58
-1
lines changed

svg/src/test/java/com/itextpdf/svg/renderers/impl/PathParsingIntegrationTest.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,21 @@ public void moreThanOneHParam() throws IOException, InterruptedException {
118118
convertAndCompareVisually(sourceFolder, destinationFolder, "moreThanOneHParam");
119119
}
120120

121+
@Test
122+
public void negativeAfterPositiveHandlingTest01() throws IOException, InterruptedException {
123+
convertAndCompareVisually(sourceFolder, destinationFolder, "negativeAfterPositiveHandling");
124+
}
125+
126+
@Test
127+
public void negativeAfterPositiveHandlingTest02() throws IOException, InterruptedException {
128+
convertAndCompareVisually(sourceFolder, destinationFolder, "negativeAfterPositiveHandlingExtendedViewbox");
129+
}
130+
131+
@Test
132+
public void insignificantSpacesTest() throws IOException, InterruptedException {
133+
convertAndCompareVisually(sourceFolder, destinationFolder, "insignificantSpaces");
134+
}
135+
121136
@Test
122137
public void decimalPointParsingTest(){
123138
PathSvgNodeRenderer path = new PathSvgNodeRenderer();
@@ -152,10 +167,19 @@ public void decimalPointParsingMinusTest(){
152167
PathSvgNodeRenderer path = new PathSvgNodeRenderer();
153168
String input = "2.35.96 3.25-.25";
154169

155-
String expected = "2.35 .96 3.25-.25";
170+
String expected = "2.35 .96 3.25 -.25";
156171
String actual = path.separateDecimalPoints(input);
157172
Assert.assertEquals(expected,actual);
158173
}
159174

175+
@Test
176+
public void negativeAfterPositiveTest(){
177+
PathSvgNodeRenderer path = new PathSvgNodeRenderer();
178+
String input = "40-50";
179+
180+
String expected = "40 -50";
181+
String actual = path.separateDecimalPoints(input);
182+
Assert.assertEquals(expected,actual);
183+
}
160184
}
161185

Lines changed: 7 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)