From 15dab4c2dbe98a567f3b5bc36e74f0eb3c1decaa Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sun, 17 Mar 2013 16:52:54 +0100 Subject: [PATCH] Add failing raster test where creating a raster without a source and then setting its size throws an error. --- test/tests/Raster.js | 19 +++++++++++++++++++ test/tests/load.js | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 test/tests/Raster.js diff --git a/test/tests/Raster.js b/test/tests/Raster.js new file mode 100644 index 00000000..1ece61da --- /dev/null +++ b/test/tests/Raster.js @@ -0,0 +1,19 @@ +/* + * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. + * http://paperjs.org/ + * + * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey + * http://lehni.org/ & http://jonathanpuckey.com/ + * + * Distributed under the MIT license. See LICENSE file for details. + * + * All rights reserved. + */ + +module('Raster'); + +test('Create a raster without a source and set its size', function() { + var raster = new Raster(); + raster.size = [640, 480]; + equals(raster.size.toString(), new Size(640, 480).toString(), true); +}); diff --git a/test/tests/load.js b/test/tests/load.js index a87b4b51..cf0a0a40 100644 --- a/test/tests/load.js +++ b/test/tests/load.js @@ -39,6 +39,8 @@ /*#*/ include('PlacedSymbol.js'); +/*#*/ include('Raster.js'); + /*#*/ include('HitResult.js'); /*#*/ include('SvgImport.js');