mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Implement various tests for Curve#isLinear()
Some are currently failing.
This commit is contained in:
parent
8b67d8a1dc
commit
fe5916766a
1 changed files with 33 additions and 0 deletions
|
@ -178,3 +178,36 @@ test('Curve#getLocationAt()', function() {
|
|||
'Should return null when offset is out of range.');
|
||||
// 'Should return null when point is not on the curve.');
|
||||
});
|
||||
|
||||
test('Curve#isLinear()', function() {
|
||||
equals(function() {
|
||||
return new Curve([100, 100], null, null, [200, 200]).isLinear();
|
||||
}, true);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], [-50, -50], null, [200, 200]).isLinear();
|
||||
}, false);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], [50, 50], null, [200, 200]).isLinear();
|
||||
}, true);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], [50, 50], [-50, -50], [200, 200]).isLinear();
|
||||
}, true);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], [50, 50], [50, 50], [200, 200]).isLinear();
|
||||
}, false);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], null, [-50, -50], [200, 200]).isLinear();
|
||||
}, true);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], null, [50, 50], [200, 200]).isLinear();
|
||||
}, false);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], null, null, [100, 100]).isLinear();
|
||||
}, true);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], [50, 50], null, [100, 100]).isLinear();
|
||||
}, false);
|
||||
equals(function() {
|
||||
return new Curve([100, 100], null, [-50, -50], [100, 100]).isLinear();
|
||||
}, false);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue