From 78a107da6568da75e3c38b98c939059cb9e060e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 28 Feb 2014 17:56:56 +0100 Subject: [PATCH] Implement unit tests for Point#isOrthogonal() --- test/tests/Point.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/tests/Point.js b/test/tests/Point.js index 448f4b2b..64a6a556 100644 --- a/test/tests/Point.js +++ b/test/tests/Point.js @@ -145,3 +145,18 @@ test('isColinear()', function() { return new Point(10, 10).isColinear(new Point(10, -10)); }, false); }); + +test('isOrthogonal()', function() { + equals(function() { + return new Point(10, 5).isOrthogonal(new Point(5, -10)); + }, true); + equals(function() { + return new Point(5, 10).isOrthogonal(new Point(-10, 5)); + }, true); + equals(function() { + return new Point(10, 10).isOrthogonal(new Point(20, 20)); + }, false); + equals(function() { + return new Point(10, 10).isOrthogonal(new Point(10, -20)); + }, false); +});