2011-07-01 06:17:45 -04:00
|
|
|
/*
|
2013-01-28 21:03:27 -05:00
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
2011-07-01 06:17:45 -04:00
|
|
|
* http://paperjs.org/
|
|
|
|
*
|
2015-12-27 12:09:25 -05:00
|
|
|
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
|
2014-01-03 19:47:16 -05:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2016-01-27 13:57:07 -05:00
|
|
|
QUnit.module('Size');
|
|
|
|
|
2011-02-13 11:26:24 -05:00
|
|
|
test('new Size(10, 20)', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var size = new Size(10, 20);
|
|
|
|
equals(size.toString(), '{ width: 10, height: 20 }');
|
2011-02-07 13:28:09 -05:00
|
|
|
});
|
|
|
|
|
2011-02-13 11:26:24 -05:00
|
|
|
test('new Size([10, 20])', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var size = new Size([10, 20]);
|
|
|
|
equals(size.toString(), '{ width: 10, height: 20 }');
|
2011-02-07 13:28:09 -05:00
|
|
|
});
|
|
|
|
|
2011-02-13 11:26:24 -05:00
|
|
|
test('new Size({width: 10, height: 20})', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var size = new Size({width: 10, height: 20});
|
|
|
|
equals(size.toString(), '{ width: 10, height: 20 }');
|
2011-02-07 13:28:09 -05:00
|
|
|
});
|
|
|
|
|
2011-02-13 11:26:24 -05:00
|
|
|
test('new Size(new Point(10, 20))', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var size = new Size(new Point(10, 20));
|
|
|
|
equals(size.toString(), '{ width: 10, height: 20 }');
|
2011-02-07 13:28:09 -05:00
|
|
|
});
|
|
|
|
|
2011-02-13 11:26:24 -05:00
|
|
|
test('new Size({ x: 10, y: 20})', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var size = new Size({x: 10, y: 20});
|
|
|
|
equals(size.toString(), '{ width: 10, height: 20 }');
|
2014-04-06 07:48:03 -04:00
|
|
|
});
|
2016-05-27 05:37:19 -04:00
|
|
|
|
|
|
|
test('new Size("10, 20")', function() {
|
|
|
|
equals(new Size('10, 20'), new Size(10, 20));
|
|
|
|
equals(new Size('10,20'), new Size(10, 20));
|
|
|
|
equals(new Size('10 20'), new Size(10, 20));
|
|
|
|
});
|