From 088dce30bcd1570546c7c7f727df12d78cedf80f Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sat, 3 Mar 2012 14:30:56 -0500 Subject: [PATCH] ColorTestCase will now return progressively more complex sets --- scripts/ColorTestCase.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/ColorTestCase.js b/scripts/ColorTestCase.js index 075009f..2b16744 100644 --- a/scripts/ColorTestCase.js +++ b/scripts/ColorTestCase.js @@ -18,7 +18,23 @@ rectest.ColorTestCase = Class( 'ColorTestCase' ) 'public getSet': function( set_id ) { - return this.__self.$( '_sets' )[ 0 ]; + var retset = [], + i = set_id; + + // generate a set that fits the requested level of complexity by + // progressively combining each set, starting with the requested set + do + { + var set = this.__self.$( '_sets' )[ i ], + j = set.length; + + while ( j-- ) + { + retset.push( set[ j ] ); + } + } while ( i-- ) + + return retset; }, 'public initRender': function( $element )