Browse Source

add more elliptical arc flag parsing test coverage

tags/3.1.0
Mike Wilkerson 3 years ago
parent
commit
4980973cb1
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      spec/spec/utils/pathParser.js

+ 9
- 1
spec/spec/utils/pathParser.js View File

@@ -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 ]

Loading…
Cancel
Save