From 87d0dc9eadefdd2c4f797238998f0c23b75ccc16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 28 Feb 2014 17:54:34 +0100 Subject: [PATCH] Implement unit tests for Point#isColinear() --- test/tests/Point.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/tests/Point.js b/test/tests/Point.js index 5cebde0b..448f4b2b 100644 --- a/test/tests/Point.js +++ b/test/tests/Point.js @@ -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); +});