summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordotnetCarpenter <jon.ronnenberg@gmail.com>2016-10-20 17:38:15 -0200
committerdotnetCarpenter <jon.ronnenberg@gmail.com>2016-10-20 17:47:40 -0200
commite4bff8c910e37f923a138fd44f6c8a3b21fa2a78 (patch)
treeb4744cfa0bb74e96e2efadf923da51eb7940d089
parent288662d0d9152602756b82f20798df9f47329bca (diff)
downloadsvg.js-e4bff8c910e37f923a138fd44f6c8a3b21fa2a78.tar.gz
svg.js-e4bff8c910e37f923a138fd44f6c8a3b21fa2a78.zip
added test for silently fixing wrong point parameters to SVG.PointArray + better descriptions for SVG.PointArray tests
-rw-r--r--dist/svg.js2
-rw-r--r--spec/spec/array.js9
2 files changed, 9 insertions, 2 deletions
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 <wout@woutfierens.com>
* @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')
})
})