From: dotnetCarpenter Date: Thu, 20 Oct 2016 19:38:15 +0000 (-0200) Subject: added test for silently fixing wrong point parameters to SVG.PointArray + better... X-Git-Tag: 2.3.6~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e4bff8c910e37f923a138fd44f6c8a3b21fa2a78;p=svg.js.git added test for silently fixing wrong point parameters to SVG.PointArray + better descriptions for SVG.PointArray tests --- diff --git a/dist/svg.js b/dist/svg.js index 864b072..1fcda5e 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens * @license MIT * -* BUILT: Thu Oct 20 2016 16:53:19 GMT-0200 (WGST) +* BUILT: Thu Oct 20 2016 17:35:41 GMT-0200 (WGST) */; (function(root, factory) { if (typeof define === 'function' && define.amd) { diff --git a/spec/spec/array.js b/spec/spec/array.js index 1671ce8..69ee8ad 100644 --- a/spec/spec/array.js +++ b/spec/spec/array.js @@ -46,7 +46,14 @@ describe('PointArray', function () { it('parses points with space delimitered x/y coordinates - even with leading or trailing space', function() { var array = new SVG.PointArray(' 1 2 3 4 ') - expect(array + '').toBe('1,2,3,4') + expect(array + '').toBe('1,2 3,4') + }) + it('parses odd number of points with space delimitered x/y coordinates and silently remove the odd point', function() { + // this is according to spec: https://svgwg.org/svg2-draft/shapes.html#DataTypePoints + + var array = new SVG.PointArray('1 2 3') + + expect(array + '').toBe('1,2') }) })