From 4aa9c8370845340182f605db013624fcd5524541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 31 Dec 2012 21:56:17 +0100 Subject: [PATCH] Change path.curves tests to include test for inserting first segment too. --- test/tests/Path_Curves.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/tests/Path_Curves.js b/test/tests/Path_Curves.js index cdfdf759..562530fd 100644 --- a/test/tests/Path_Curves.js +++ b/test/tests/Path_Curves.js @@ -19,12 +19,12 @@ module('Path Curves'); test('path.curves Synchronisation', function() { var path = new Path(); - path.add(new Point(0, 100)); - equals(path.segments.toString(), "{ point: { x: 0, y: 100 } }", "path.segments: path.add(new Point(0, 100));"); - equals(path.curves.toString(), "", "path.curves: path.add(new Point(0, 100));"); path.add(new Point(100, 100)); - equals(path.segments.toString(), "{ point: { x: 0, y: 100 } },{ point: { x: 100, y: 100 } }", "path.segments: path.add(new Point(100, 100));"); - equals(path.curves.toString(), "{ point1: { x: 0, y: 100 }, point2: { x: 100, y: 100 } }", "path.curves: path.add(new Point(100, 100));"); + equals(path.segments.toString(), "{ point: { x: 100, y: 100 } }", "path.segments: path.add(new Point(100, 100));"); + equals(path.curves.toString(), "", "path.curves: path.add(new Point(100, 100));"); + path.insert(0, new Point(0, 100)); + equals(path.segments.toString(), "{ point: { x: 0, y: 100 } },{ point: { x: 100, y: 100 } }", "path.segments: path.insert(0, new Point(0, 100));"); + equals(path.curves.toString(), "{ point1: { x: 0, y: 100 }, point2: { x: 100, y: 100 } }", "path.curves: path.insert(0, new Point(0, 100));"); path.insert(1, {point:[50, 0], handleIn:[-25, 0], handleOut:[25, 0]}); equals(path.segments.toString(), "{ point: { x: 0, y: 100 } },{ point: { x: 50, y: 0 }, handleIn: { x: -25, y: 0 }, handleOut: { x: 25, y: 0 } },{ point: { x: 100, y: 100 } }", "path.segments: path.insert(1, {point:[50, 0], handleIn:[-25, 0], handleOut:[25, 0]});"); equals(path.curves.toString(), "{ point1: { x: 0, y: 100 }, handle2: { x: -25, y: 0 }, point2: { x: 50, y: 0 } },{ point1: { x: 50, y: 0 }, handle1: { x: 25, y: 0 }, point2: { x: 100, y: 100 } }", "path.curves: path.insert(1, {point:[50, 0], handleIn:[-25, 0], handleOut:[25, 0]});");