mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
30 lines
706 B
JavaScript
30 lines
706 B
JavaScript
|
module('Size');
|
||
|
test('new Size(10, 20)', function(){
|
||
|
var size = new Size(10, 20);
|
||
|
equals(size.width, 10);
|
||
|
equals(size.height, 20);
|
||
|
});
|
||
|
|
||
|
test('new Size([10, 20])', function(){
|
||
|
var size = new Size([10, 20]);
|
||
|
equals(size.width, 10);
|
||
|
equals(size.height, 20);
|
||
|
});
|
||
|
|
||
|
test('new Size({width: 10, height: 20})', function(){
|
||
|
var size = new Size({width: 10, height: 20});
|
||
|
equals(size.width, 10);
|
||
|
equals(size.height, 20);
|
||
|
});
|
||
|
|
||
|
test('new Size(new Point(10, 20))', function(){
|
||
|
var size = new Size(new Point(10, 20));
|
||
|
equals(size.width, 10);
|
||
|
equals(size.height, 20);
|
||
|
});
|
||
|
|
||
|
test('new Size({ x: 10, y: 20})', function(){
|
||
|
var size = new Size({x: 10, y: 20});
|
||
|
equals(size.width, 10);
|
||
|
equals(size.height, 20);
|
||
|
});
|