paper.js/test/tests/Size.js

37 lines
1 KiB
JavaScript
Raw Normal View History

2011-07-01 06:17:45 -04:00
/*
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
2011-07-01 06:17:45 -04:00
* http://paperjs.org/
*
2014-01-03 19:47:16 -05:00
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
2011-07-01 06:17:45 -04:00
*
* Distributed under the MIT license. See LICENSE file for details.
*
* All rights reserved.
*/
2011-02-07 13:28:09 -05:00
module('Size');
test('new Size(10, 20)', function() {
2011-02-07 13:28:09 -05:00
var size = new Size(10, 20);
equals(size.toString(), '{ width: 10, height: 20 }');
2011-02-07 13:28:09 -05:00
});
test('new Size([10, 20])', function() {
2011-02-07 13:28:09 -05:00
var size = new Size([10, 20]);
equals(size.toString(), '{ width: 10, height: 20 }');
2011-02-07 13:28:09 -05:00
});
test('new Size({width: 10, height: 20})', function() {
2011-02-07 13:28:09 -05:00
var size = new Size({width: 10, height: 20});
equals(size.toString(), '{ width: 10, height: 20 }');
2011-02-07 13:28:09 -05:00
});
test('new Size(new Point(10, 20))', function() {
2011-02-07 13:28:09 -05:00
var size = new Size(new Point(10, 20));
equals(size.toString(), '{ width: 10, height: 20 }');
2011-02-07 13:28:09 -05:00
});
test('new Size({ x: 10, y: 20})', function() {
2011-02-07 13:28:09 -05:00
var size = new Size({x: 10, y: 20});
equals(size.toString(), '{ width: 10, height: 20 }');
2011-02-07 13:28:09 -05:00
});