mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Add named arguments tests for Group & Rectangle.
This commit is contained in:
parent
91dfc9b1ea
commit
c6602d4fcf
2 changed files with 23 additions and 0 deletions
|
@ -16,11 +16,21 @@ test('new Rectangle(new Point(10, 20), new Size(30, 40));', function() {
|
|||
equals(rect.toString(), '{ x: 10, y: 20, width: 30, height: 40 }');
|
||||
});
|
||||
|
||||
test('new Rectangle({ point: new Point(10, 20), size: new Size(30, 40)});', function() {
|
||||
var rect = new Rectangle({ point: new Point(10, 20), size: new Size(30, 40)});
|
||||
equals(rect.toString(), '{ x: 10, y: 20, width: 30, height: 40 }');
|
||||
});
|
||||
|
||||
test('new Rectangle([10, 20], [30, 40]);', function() {
|
||||
var rect = new Rectangle([10, 20], [30, 40]);
|
||||
equals(rect.toString(), '{ x: 10, y: 20, width: 30, height: 40 }');
|
||||
});
|
||||
|
||||
test('new Rectangle({from: [10, 20], to: [30, 40]});', function() {
|
||||
var rect = new Rectangle({from: [10, 20], to: [30, 40]});
|
||||
equals(rect.toString(), '{ x: 10, y: 20, width: 30, height: 40 }');
|
||||
});
|
||||
|
||||
test('new Rectangle(new Point(10, 20), new Point(30, 40));', function() {
|
||||
var rect = new Rectangle(new Point(10, 20), new Point(30, 40));
|
||||
equals(rect.toString(), '{ x: 10, y: 20, width: 20, height: 20 }');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue