mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Implement unit tests for Point#isColinear()
This commit is contained in:
parent
c1ccdf6cb7
commit
87d0dc9ead
1 changed files with 15 additions and 0 deletions
|
@ -130,3 +130,18 @@ test('equals()', function() {
|
|||
return new Point(0, 0).equals(null);
|
||||
}, false);
|
||||
});
|
||||
|
||||
test('isColinear()', function() {
|
||||
equals(function() {
|
||||
return new Point(10, 5).isColinear(new Point(20, 10));
|
||||
}, true);
|
||||
equals(function() {
|
||||
return new Point(5, 10).isColinear(new Point(-5, -10));
|
||||
}, true);
|
||||
equals(function() {
|
||||
return new Point(10, 10).isColinear(new Point(20, 10));
|
||||
}, false);
|
||||
equals(function() {
|
||||
return new Point(10, 10).isColinear(new Point(10, -10));
|
||||
}, false);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue