-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.js
51 lines (42 loc) · 1.31 KB
/
tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/** out */
QUnit.test( "lineMath 0 degree", function( assert ) {
var A = [0,2], B = [0,0];
var coords = lineMath(A, B);
assert.deepEqual( coords, [A, [0,1], B] );
});
QUnit.test( "lineMath 45 degree", function( assert ) {
var A = [0,2], B = [2,0];
var coords = lineMath(A, B);
assert.deepEqual( coords, [A, [1,1], B] );
});
QUnit.test( "lineMath 90 degree", function( assert ) {
var A = [0,2], B = [2,2];
var coords = lineMath(A, B);
assert.deepEqual( coords, [A, [1,2], B] );
});
QUnit.test( "lineMath 135 degree", function( assert ) {
var A = [0,2], B = [2,4];
var coords = lineMath(A, B);
assert.deepEqual( coords, [A, [1,3], B] );
});
/** in **/
QUnit.test( "lineMath 180 degree", function( assert ) {
var A = [0,0], B = [0,2];
var coords = lineMath(A, B);
assert.deepEqual( coords, [A, [0,1], B] );
});
QUnit.test( "lineMath 225 degree", function( assert ) {
var A = [2,0], B = [0,2];
var coords = lineMath(A, B);
assert.deepEqual( coords, [A, [1,1], B] );
});
QUnit.test( "lineMath 270 degree", function( assert ) {
var A = [2,2], B = [0,2];
var coords = lineMath(A, B);
assert.deepEqual( coords, [A, [1,2], B] );
});
QUnit.test( "lineMath 315 degree", function( assert ) {
var A = [2,4], B = [0,2];
var coords = lineMath(A, B);
assert.deepEqual( coords, [A, [1,3], B] );
});