From: Mike Wilkerson <11575183+mlwilkerson@users.noreply.github.com> Date: Sat, 12 Dec 2020 19:47:50 +0000 (-0800) Subject: add more elliptical arc flag parsing test coverage X-Git-Tag: 3.1.0~10^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4980973cb1914d41392373e844ff323fa589c66f;p=svg.js.git add more elliptical arc flag parsing test coverage --- diff --git a/spec/spec/utils/pathParser.js b/spec/spec/utils/pathParser.js index 58d1453..09cfa4a 100644 --- a/spec/spec/utils/pathParser.js +++ b/spec/spec/utils/pathParser.js @@ -103,7 +103,7 @@ describe('pathParser.js', () => { [ 'Z' ] ]) - // "a" commands without optional whitespace around the flag params + // "a" commands without optional whitespace around the flag params and ending coordinate pair expect(pathParser('a32 32 0 00.03-45.22', false)).toEqual([ [ 'a', 32.0, 32.0, 0.0, 0.0, 0.0, 0.03, -45.22 ], ]) @@ -124,6 +124,14 @@ describe('pathParser.js', () => { [ 'a', 2.51, 2.51, 0, 0, 1, 0.25, 0.32 ], ]) + expect(pathParser('a2.51 2.51 0 00.25.32', false)).toEqual([ + [ 'a', 2.51, 2.51, 0, 0, 0, 0.25, 0.32 ], + ]) + + expect(pathParser('a2.51 2.51 0 000.25.32', false)).toEqual([ + [ 'a', 2.51, 2.51, 0, 0, 0, 0.25, 0.32 ], + ]) + expect(pathParser('a48 48 0 1148-48 48 48 0 01-48 48', false)).toEqual([ [ 'a', 48.0, 48.0, 0.0, 1.0, 1.0, 48.0, -48.0 ], [ 'a', 48.0, 48.0, 0.0, 0.0, 1.0, -48.0, 48.0 ]