mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Implement more PathItem#compare() tests.
Two failing for now.
This commit is contained in:
parent
aa2e1d753b
commit
7d3d7351ab
1 changed files with 20 additions and 5 deletions
|
@ -126,9 +126,18 @@ test('PathItem#compare()', function() {
|
||||||
radius: 100
|
radius: 100
|
||||||
});
|
});
|
||||||
var square = new Path.Rectangle({
|
var square = new Path.Rectangle({
|
||||||
point: [0, 0],
|
point: [100, 100],
|
||||||
size: [100, 100]
|
size: [100, 100]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var square2 = square.clone();
|
||||||
|
square2.divideAt(50);
|
||||||
|
square2.divideAt(150);
|
||||||
|
|
||||||
|
var circle2 = circle.clone();
|
||||||
|
circle2.divideAt(50);
|
||||||
|
circle2.divideAt(100);
|
||||||
|
|
||||||
equals(function() {
|
equals(function() {
|
||||||
return square.compare(null);
|
return square.compare(null);
|
||||||
}, false, 'Comparing with an invalid item should return false.');
|
}, false, 'Comparing with an invalid item should return false.');
|
||||||
|
@ -145,9 +154,15 @@ test('PathItem#compare()', function() {
|
||||||
return circle.compare(circle.clone());
|
return circle.compare(circle.clone());
|
||||||
}, true, 'Comparing a circle with its clone should return true.');
|
}, true, 'Comparing a circle with its clone should return true.');
|
||||||
equals(function() {
|
equals(function() {
|
||||||
return square.compare(square.clone().rotate(90));
|
return square.compare(square2);
|
||||||
}, true, 'Comparing a square with its rotated clone should return true.');
|
}, true, 'Comparing a square with an identical square with additional segments should return true.');
|
||||||
equals(function() {
|
equals(function() {
|
||||||
return circle.compare(circle.clone().rotate(90));
|
return square2.compare(square);
|
||||||
}, true, 'Comparing a circle with its rotated clone should return true.');
|
}, true, 'Comparing a square with an identical square with additional segments should return true.');
|
||||||
|
equals(function() {
|
||||||
|
return circle.compare(circle2);
|
||||||
|
}, true, 'Comparing a circle with an identical circle with additional segments should return true.');
|
||||||
|
equals(function() {
|
||||||
|
return circle2.compare(circle);
|
||||||
|
}, true, 'Comparing a circle with an identical circle with additional segments should return true.');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue