Skip to content

Commit 24443c5

Browse files
committed
Define failing test for issue paperjs#200.
1 parent 74f6a93 commit 24443c5

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

test/tests/Path_Curves.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,20 @@ test('path.curves Synchronisation', function() {
3636
equals(path.curves.toString(), "{ point1: { x: 0, y: 100 }, point2: { x: 100, y: 100 } },{ point1: { x: 100, y: 100 }, point2: { x: 0, y: 100 } }", "path.curves: path.add(new Point(100, 100));\npath.removeSegments(1, 2);");
3737

3838
// Transform the path, and the curves length should be invalidated (first, force-cache the first segment's length by accessing it
39-
path.curves[0].length;
39+
var length = path.curves[0].length;
4040
ok(path.curves[0]._length, 'Curve length does not appear to be cached');
4141
path.scale(2, [0, 0]);
4242
equals(path.curves[0].length, 200, 'Curve length should be updated when path is transformed');
43+
44+
var points = [];
45+
for (var i = 0; i < 40; i++)
46+
points.push(Point.random());
47+
var path = new Path(points);
48+
equals(path.segments.length, 40, 'segments.length');
49+
equals(path.curves.length, 39, 'curves.length');
50+
path.removeSegments();
51+
equals(path.segments.length, 0, 'segments.length');
52+
equals(path.curves.length, 0, 'curves.length');
4353
});
4454

4555
test('path.curves on Closed Paths', function() {

0 commit comments

Comments
 (0)