Skip to content

Commit

Permalink
Add more parse tests for viewBoxes with scientific notation
Browse files Browse the repository at this point in the history
  • Loading branch information
jams2 committed Aug 4, 2023
1 parent 7a4b028 commit 840b209
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_svg_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ def test_view_box_re(self):
("+.1,0,0,0", ViewBox(0.1, 0, 0, 0)),
("-.1,0,0,0", ViewBox(-0.1, 0, 0, 0)),
# https://github.com/wagtail/Willow/issues/127
# More combinations that include scientific notation
(
"-5.000000011410315e-06 0.0 750.00001 525.000007",
ViewBox(-5.000000011410315e-06, 0.0, 750.00001, 525.000007),
Expand All @@ -443,6 +444,31 @@ def test_view_box_re(self):
-5.000000011410315e-06,
),
),
(
"-5.000000011410315e06 0.0 750.00001 525.000007",
ViewBox(-5.000000011410315e06, 0.0, 750.00001, 525.000007),
),
(
"0.0 -5.000000011410315e06 750.00001 525.000007",
ViewBox(0.0, -5.000000011410315e06, 750.00001, 525.000007),
),
(
"0.0 0.0 -5.000000011410315e06 525.000007",
ViewBox(0.0, 0.0, -5.000000011410315e06, 525.000007),
),
(
"0.0 0.0 750.00001 -5.000000011410315e06",
ViewBox(0.0, 0.0, 750.00001, -5.000000011410315e06),
),
(
"-5.000000011410315e06 -5.000000011410315e06 -5.000000011410315e06 -5.000000011410315e06",
ViewBox(
-5.000000011410315e06,
-5.000000011410315e06,
-5.000000011410315e06,
-5.000000011410315e06,
),
),
]
for value, expected in params:
with self.subTest(value=value, expected=expected):
Expand Down

0 comments on commit 840b209

Please sign in to comment.