From 30307a034125417d1d8691cae397dbd932ebc90e Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Wed, 27 Apr 2011 12:13:28 +0200 Subject: [PATCH] Add failing test for Path#reverse. --- 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 6fe0e4ac..7a2f2de7 100644 --- a/test/tests/Path.js +++ b/test/tests/Path.js @@ -88,4 +88,18 @@ test('Is the path deselected after setting a new list of segments?', function() path.segments = [[0, 10]]; equals(path.selected, false); equals(doc.selectedItems.length, 0); -}); \ No newline at end of file +}); + +test('Path#reverse', function() { + var doc = new Document(); + var path = new Path.Circle([100, 100], 30); + path.reverse(); + compareSegmentLists(path.segments, [new Segment(new Point(100, 130), + new Point(-16.568359375, 0), new Point(16.568359375, 0)), + new Segment(new Point(130, 100), new Point(0, 16.568359375), + new Point(0, -16.568359375)), new Segment(new Point(100, 70), + new Point(16.568359375, 0), new Point(-16.568359375, 0)), + new Segment(new Point(70, 100), new Point(0, -16.568359375), + new Point(0, 16.568359375))]); +}); +