diff options
author | Mike Wilkerson <11575183+mlwilkerson@users.noreply.github.com> | 2020-12-12 11:47:50 -0800 |
---|---|---|
committer | Mike Wilkerson <11575183+mlwilkerson@users.noreply.github.com> | 2020-12-12 11:47:50 -0800 |
commit | 4980973cb1914d41392373e844ff323fa589c66f (patch) | |
tree | 1502188d4672709f2bd9b0d044e8750acce09235 /spec | |
parent | fb71b52fa3dc23380d9b168ac40aa7a00f2fe0c9 (diff) | |
download | svg.js-4980973cb1914d41392373e844ff323fa589c66f.tar.gz svg.js-4980973cb1914d41392373e844ff323fa589c66f.zip |
add more elliptical arc flag parsing test coverage
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/utils/pathParser.js | 10 |
1 files changed, 9 insertions, 1 deletions
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 ] |