From af5aa67c36bdea6f89fc5595ee104815ff338ff3 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sun, 5 Jun 2011 19:50:24 +0200 Subject: [PATCH] Change Path#removeSegments(from, to) test to fail and add a todo questioning if its behaviour is correct. Also add a failing Path#removeSegments() test. --- test/tests/Path.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/tests/Path.js b/test/tests/Path.js index 851b78d1..aaf44178 100644 --- a/test/tests/Path.js +++ b/test/tests/Path.js @@ -70,7 +70,9 @@ test('path.remove()', function() { return path.segments.length; }, 2); - path.removeSegments(0, 2); + // TODO: shouldn't this remove two segments? The segments from index 0 till + // index 1? + path.removeSegments(0, 1); equals(function() { return path.segments.length; }, 0); @@ -82,6 +84,18 @@ test('path.remove()', function() { }, 0); }); +test('path.removeSegments()', function() { + var path = new Path(); + path.add(0, 0); + path.add(10, 0); + path.add(20, 0); + path.add(30, 0); + + path.removeSegments(); + equals(function() { + return path.segments.length; + }, 0); +}); test('Is the path deselected after setting a new list of segments?', function() { var path = new Path([0, 0]);