Implement unit tests for Point#isColinear()

This commit is contained in:
Jürg Lehni 2014-02-28 17:54:34 +01:00
parent c1ccdf6cb7
commit 87d0dc9ead

View file

@ -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);
});