()
| 11 | // Helper: create a mock triangle with an axis-aligned right triangle |
| 12 | // vertices: (0,0), (100,0), (0,100) |
| 13 | function makeTriangle() |
| 14 | { |
| 15 | return { |
| 16 | contains: function (x, y) |
| 17 | { |
| 18 | // Inside if x>=0, y>=0, x+y<=100 |
| 19 | return x >= 0 && y >= 0 && (x + y) <= 100; |
| 20 | }, |
| 21 | getLineA: function () { return makeLine(0, 0, 100, 0); }, // bottom edge |
| 22 | getLineB: function () { return makeLine(100, 0, 0, 100); }, // hypotenuse |
| 23 | getLineC: function () { return makeLine(0, 100, 0, 0); } // left edge |
| 24 | }; |
| 25 | } |
| 26 | |
| 27 | it('should return true when the line starts inside the triangle', function () |
| 28 | { |
no test coverage detected
searching dependent graphs…