Skip to content

Commit af5aa67

Browse files
committed
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.
1 parent e4eb463 commit af5aa67

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

test/tests/Path.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ test('path.remove()', function() {
7070
return path.segments.length;
7171
}, 2);
7272

73-
path.removeSegments(0, 2);
73+
// TODO: shouldn't this remove two segments? The segments from index 0 till
74+
// index 1?
75+
path.removeSegments(0, 1);
7476
equals(function() {
7577
return path.segments.length;
7678
}, 0);
@@ -82,6 +84,18 @@ test('path.remove()', function() {
8284
}, 0);
8385
});
8486

87+
test('path.removeSegments()', function() {
88+
var path = new Path();
89+
path.add(0, 0);
90+
path.add(10, 0);
91+
path.add(20, 0);
92+
path.add(30, 0);
93+
94+
path.removeSegments();
95+
equals(function() {
96+
return path.segments.length;
97+
}, 0);
98+
});
8599

86100
test('Is the path deselected after setting a new list of segments?', function() {
87101
var path = new Path([0, 0]);

0 commit comments

Comments
 (0)