1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma/jsref.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,632 @@ 1.4 +var completed = false; 1.5 +var testcases; 1.6 +var tc = 0; 1.7 + 1.8 +SECTION = ""; 1.9 +VERSION = ""; 1.10 +BUGNUMBER = ""; 1.11 +TITLE = ""; 1.12 + 1.13 +/* 1.14 + * constant strings 1.15 + */ 1.16 +var GLOBAL = "[object global]"; 1.17 +var PASSED = " PASSED!" 1.18 +var FAILED = " FAILED! expected: "; 1.19 +var DEBUG = false; 1.20 + 1.21 +TZ_DIFF = -8; 1.22 + 1.23 +var TT = ""; 1.24 +var TT_ = ""; 1.25 +var BR = ""; 1.26 +var NBSP = " "; 1.27 +var CR = "\n"; 1.28 +var FONT = ""; 1.29 +var FONT_ = ""; 1.30 +var FONT_RED = ""; 1.31 +var FONT_GREEN = ""; 1.32 +var B = ""; 1.33 +var B_ = "" 1.34 +var H2 = ""; 1.35 +var H2_ = ""; 1.36 +var HR = ""; 1.37 +var DEBUG = false; 1.38 + 1.39 +var PASSED = " PASSED!" 1.40 +var FAILED = " FAILED! expected: "; 1.41 + 1.42 +function test() { 1.43 + for ( tc=0; tc < testcases.length; tc++ ) { 1.44 + testcases[tc].passed = writeTestCaseResult( 1.45 + testcases[tc].expect, 1.46 + testcases[tc].actual, 1.47 + testcases[tc].description +" = "+ 1.48 + testcases[tc].actual ); 1.49 + 1.50 + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; 1.51 + } 1.52 + stopTest(); 1.53 + return ( testcases ); 1.54 +} 1.55 +/* wrapper for test cas constructor that doesn't require the SECTION 1.56 + * argument. 1.57 + */ 1.58 + 1.59 +function AddTestCase( description, expect, actual ) { 1.60 + testcases[tc++] = new TestCase( SECTION, description, expect, actual ); 1.61 +} 1.62 + 1.63 +function TestCase( n, d, e, a ) { 1.64 + this.name = n; 1.65 + this.description = d; 1.66 + this.expect = e; 1.67 + this.actual = a; 1.68 + this.passed = true; 1.69 + this.reason = ""; 1.70 + this.bugnumber = BUGNUMBER; 1.71 + 1.72 + this.passed = getTestCaseResult( this.expect, this.actual ); 1.73 + if ( DEBUG ) { 1.74 + print( "added " + this.description ); 1.75 + } 1.76 +} 1.77 + 1.78 +/* 1.79 + * Set up test environment. 1.80 + * 1.81 + */ 1.82 +function startTest() { 1.83 + if ( version ) { 1.84 + // JavaScript 1.3 is supposed to be compliant ecma version 1.0 1.85 + if ( VERSION == "ECMA_1" ) { 1.86 + version ( "130" ); 1.87 + } 1.88 + if ( VERSION == "JS_1.3" ) { 1.89 + version ( "130" ); 1.90 + } 1.91 + if ( VERSION == "JS_1.2" ) { 1.92 + version ( "120" ); 1.93 + } 1.94 + if ( VERSION == "JS_1.1" ) { 1.95 + version ( "110" ); 1.96 + } 1.97 + // for ecma version 2.0, we will leave the javascript version to 1.98 + // the default ( for now ). 1.99 + } 1.100 + 1.101 + // print out bugnumber 1.102 + 1.103 + if ( BUGNUMBER ) { 1.104 + print ("BUGNUMBER: " + BUGNUMBER ); 1.105 + } 1.106 + 1.107 + testcases = new Array(); 1.108 + tc = 0; 1.109 +} 1.110 + 1.111 + 1.112 +function test() { 1.113 + for ( tc=0; tc < testcases.length; tc++ ) { 1.114 + testcases[tc].passed = writeTestCaseResult( 1.115 + testcases[tc].expect, 1.116 + testcases[tc].actual, 1.117 + testcases[tc].description +" = "+ testcases[tc].actual ); 1.118 + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; 1.119 + } 1.120 + stopTest(); 1.121 + return ( testcases ); 1.122 +} 1.123 + 1.124 + 1.125 +function getTestCaseResult( expect, actual ) { 1.126 + // because ( NaN == NaN ) always returns false, need to do 1.127 + // a special compare to see if we got the right result. 1.128 + if ( actual != actual ) { 1.129 + if ( typeof actual == "object" ) { 1.130 + actual = "NaN object"; 1.131 + } else { 1.132 + actual = "NaN number"; 1.133 + } 1.134 + } 1.135 + if ( expect != expect ) { 1.136 + if ( typeof expect == "object" ) { 1.137 + expect = "NaN object"; 1.138 + } else { 1.139 + expect = "NaN number"; 1.140 + } 1.141 + } 1.142 + 1.143 + var passed = ( expect == actual ) ? true : false; 1.144 + 1.145 + // if both objects are numbers 1.146 + // need to replace w/ IEEE standard for rounding 1.147 + if ( !passed 1.148 + && typeof(actual) == "number" 1.149 + && typeof(expect) == "number" 1.150 + ) { 1.151 + if ( Math.abs(actual-expect) < 0.0000001 ) { 1.152 + passed = true; 1.153 + } 1.154 + } 1.155 + 1.156 + // verify type is the same 1.157 + if ( typeof(expect) != typeof(actual) ) { 1.158 + passed = false; 1.159 + } 1.160 + 1.161 + return passed; 1.162 +} 1.163 +function writeTestCaseResult( expect, actual, string ) { 1.164 + var passed = getTestCaseResult( expect, actual ); 1.165 + writeFormattedResult( expect, actual, string, passed ); 1.166 + return passed; 1.167 +} 1.168 +function writeFormattedResult( expect, actual, string, passed ) { 1.169 + var s = TT + string ; 1.170 + 1.171 + for ( k = 0; 1.172 + k < (60 - string.length >= 0 ? 60 - string.length : 5) ; 1.173 + k++ ) { 1.174 + } 1.175 + 1.176 + s += B ; 1.177 + s += ( passed ) ? FONT_GREEN + NBSP + PASSED : FONT_RED + NBSP + FAILED + expect + TT_ ; 1.178 + 1.179 + print( s + FONT_ + B_ + TT_ ); 1.180 + 1.181 + return passed; 1.182 +} 1.183 + 1.184 +function writeHeaderToLog( string ) { 1.185 + print( H2 + string + H2_ ); 1.186 +} 1.187 +function stopTest() 1.188 +{ 1.189 + var sizeTag = "<#TEST CASES SIZE>"; 1.190 + var doneTag = "<#TEST CASES DONE>"; 1.191 + var beginTag = "<#TEST CASE "; 1.192 + var endTag = ">"; 1.193 + 1.194 + print(sizeTag); 1.195 + print(testcases.length); 1.196 + for (tc = 0; tc < testcases.length; tc++) 1.197 + { 1.198 + print(beginTag + 'PASSED' + endTag); 1.199 + print(testcases[tc].passed); 1.200 + print(beginTag + 'NAME' + endTag); 1.201 + print(testcases[tc].name); 1.202 + print(beginTag + 'EXPECTED' + endTag); 1.203 + print(testcases[tc].expect); 1.204 + print(beginTag + 'ACTUAL' + endTag); 1.205 + print(testcases[tc].actual); 1.206 + print(beginTag + 'DESCRIPTION' + endTag); 1.207 + print(testcases[tc].description); 1.208 + print(beginTag + 'REASON' + endTag); 1.209 + print(( testcases[tc].passed ) ? "" : "wrong value "); 1.210 + print(beginTag + 'BUGNUMBER' + endTag); 1.211 + print( BUGNUMBER ); 1.212 + } 1.213 + print(doneTag); 1.214 + print( HR ); 1.215 + gc(); 1.216 +} 1.217 +function getFailedCases() { 1.218 + for ( var i = 0; i < testcases.length; i++ ) { 1.219 + if ( ! testcases[i].passed ) { 1.220 + print( testcases[i].description +" = " +testcases[i].actual +" expected: "+ testcases[i].expect ); 1.221 + } 1.222 + } 1.223 +} 1.224 +function err( msg, page, line ) { 1.225 + testcases[tc].actual = "error"; 1.226 + testcases[tc].reason = msg; 1.227 + writeTestCaseResult( testcases[tc].expect, 1.228 + testcases[tc].actual, 1.229 + testcases[tc].description +" = "+ testcases[tc].actual + 1.230 + ": " + testcases[tc].reason ); 1.231 + stopTest(); 1.232 + return true; 1.233 +} 1.234 + 1.235 +/** 1.236 + * Type Conversion functions used by Type Conversion 1.237 + * 1.238 + */ 1.239 + 1.240 + 1.241 + 1.242 + /* 1.243 + * Date functions used by tests in Date suite 1.244 + * 1.245 + */ 1.246 +var msPerDay = 86400000; 1.247 +var HoursPerDay = 24; 1.248 +var MinutesPerHour = 60; 1.249 +var SecondsPerMinute = 60; 1.250 +var msPerSecond = 1000; 1.251 +var msPerMinute = 60000; // msPerSecond * SecondsPerMinute 1.252 +var msPerHour = 3600000; // msPerMinute * MinutesPerHour 1.253 + 1.254 +var TIME_1970 = 0; 1.255 +var TIME_2000 = 946684800000; 1.256 +var TIME_1900 = -2208988800000; 1.257 + 1.258 +function Day( t ) { 1.259 + return ( Math.floor(t/msPerDay ) ); 1.260 +} 1.261 +function DaysInYear( y ) { 1.262 + if ( y % 4 != 0 ) { 1.263 + return 365; 1.264 + } 1.265 + if ( (y % 4 == 0) && (y % 100 != 0) ) { 1.266 + return 366; 1.267 + } 1.268 + if ( (y % 100 == 0) && (y % 400 != 0) ) { 1.269 + return 365; 1.270 + } 1.271 + if ( (y % 400 == 0) ){ 1.272 + return 366; 1.273 + } else { 1.274 + return "ERROR: DaysInYear(" + y + ") case not covered"; 1.275 + } 1.276 +} 1.277 +function TimeInYear( y ) { 1.278 + return ( DaysInYear(y) * msPerDay ); 1.279 +} 1.280 +function DayNumber( t ) { 1.281 + return ( Math.floor( t / msPerDay ) ); 1.282 +} 1.283 +function TimeWithinDay( t ) { 1.284 + if ( t < 0 ) { 1.285 + return ( (t % msPerDay) + msPerDay ); 1.286 + } else { 1.287 + return ( t % msPerDay ); 1.288 + } 1.289 +} 1.290 +function YearNumber( t ) { 1.291 +} 1.292 +function TimeFromYear( y ) { 1.293 + return ( msPerDay * DayFromYear(y) ); 1.294 +} 1.295 +function DayFromYear( y ) { 1.296 + return ( 365*(y-1970) + 1.297 + Math.floor((y-1969)/4) - 1.298 + Math.floor((y-1901)/100) + 1.299 + Math.floor((y-1601)/400) ); 1.300 +} 1.301 +function InLeapYear( t ) { 1.302 + if ( DaysInYear(YearFromTime(t)) == 365 ) { 1.303 + return 0; 1.304 + } 1.305 + if ( DaysInYear(YearFromTime(t)) == 366 ) { 1.306 + return 1; 1.307 + } else { 1.308 + return "ERROR: InLeapYear("+t+") case not covered"; 1.309 + } 1.310 +} 1.311 +function YearFromTime( t ) { 1.312 + t = Number( t ); 1.313 + var sign = ( t < 0 ) ? -1 : 1; 1.314 + var year = ( sign < 0 ) ? 1969 : 1970; 1.315 + for ( var timeToTimeZero = t; ; ) { 1.316 + // subtract the current year's time from the time that's left. 1.317 + timeToTimeZero -= sign * TimeInYear(year) 1.318 + 1.319 + // if there's less than the current year's worth of time left, then break. 1.320 + if ( sign < 0 ) { 1.321 + if ( sign * timeToTimeZero <= 0 ) { 1.322 + break; 1.323 + } else { 1.324 + year += sign; 1.325 + } 1.326 + } else { 1.327 + if ( sign * timeToTimeZero < 0 ) { 1.328 + break; 1.329 + } else { 1.330 + year += sign; 1.331 + } 1.332 + } 1.333 + } 1.334 + return ( year ); 1.335 +} 1.336 +function MonthFromTime( t ) { 1.337 + // i know i could use switch but i'd rather not until it's part of ECMA 1.338 + var day = DayWithinYear( t ); 1.339 + var leap = InLeapYear(t); 1.340 + 1.341 + if ( (0 <= day) && (day < 31) ) { 1.342 + return 0; 1.343 + } 1.344 + if ( (31 <= day) && (day < (59+leap)) ) { 1.345 + return 1; 1.346 + } 1.347 + if ( ((59+leap) <= day) && (day < (90+leap)) ) { 1.348 + return 2; 1.349 + } 1.350 + if ( ((90+leap) <= day) && (day < (120+leap)) ) { 1.351 + return 3; 1.352 + } 1.353 + if ( ((120+leap) <= day) && (day < (151+leap)) ) { 1.354 + return 4; 1.355 + } 1.356 + if ( ((151+leap) <= day) && (day < (181+leap)) ) { 1.357 + return 5; 1.358 + } 1.359 + if ( ((181+leap) <= day) && (day < (212+leap)) ) { 1.360 + return 6; 1.361 + } 1.362 + if ( ((212+leap) <= day) && (day < (243+leap)) ) { 1.363 + return 7; 1.364 + } 1.365 + if ( ((243+leap) <= day) && (day < (273+leap)) ) { 1.366 + return 8; 1.367 + } 1.368 + if ( ((273+leap) <= day) && (day < (304+leap)) ) { 1.369 + return 9; 1.370 + } 1.371 + if ( ((304+leap) <= day) && (day < (334+leap)) ) { 1.372 + return 10; 1.373 + } 1.374 + if ( ((334+leap) <= day) && (day < (365+leap)) ) { 1.375 + return 11; 1.376 + } else { 1.377 + return "ERROR: MonthFromTime("+t+") not known"; 1.378 + } 1.379 +} 1.380 +function DayWithinYear( t ) { 1.381 + return( Day(t) - DayFromYear(YearFromTime(t))); 1.382 +} 1.383 +function DateFromTime( t ) { 1.384 + var day = DayWithinYear(t); 1.385 + var month = MonthFromTime(t); 1.386 + 1.387 + if ( month == 0 ) { 1.388 + return ( day + 1 ); 1.389 + } 1.390 + if ( month == 1 ) { 1.391 + return ( day - 30 ); 1.392 + } 1.393 + if ( month == 2 ) { 1.394 + return ( day - 58 - InLeapYear(t) ); 1.395 + } 1.396 + if ( month == 3 ) { 1.397 + return ( day - 89 - InLeapYear(t)); 1.398 + } 1.399 + if ( month == 4 ) { 1.400 + return ( day - 119 - InLeapYear(t)); 1.401 + } 1.402 + if ( month == 5 ) { 1.403 + return ( day - 150- InLeapYear(t)); 1.404 + } 1.405 + if ( month == 6 ) { 1.406 + return ( day - 180- InLeapYear(t)); 1.407 + } 1.408 + if ( month == 7 ) { 1.409 + return ( day - 211- InLeapYear(t)); 1.410 + } 1.411 + if ( month == 8 ) { 1.412 + return ( day - 242- InLeapYear(t)); 1.413 + } 1.414 + if ( month == 9 ) { 1.415 + return ( day - 272- InLeapYear(t)); 1.416 + } 1.417 + if ( month == 10 ) { 1.418 + return ( day - 303- InLeapYear(t)); 1.419 + } 1.420 + if ( month == 11 ) { 1.421 + return ( day - 333- InLeapYear(t)); 1.422 + } 1.423 + 1.424 + return ("ERROR: DateFromTime("+t+") not known" ); 1.425 +} 1.426 +function WeekDay( t ) { 1.427 + var weekday = (Day(t)+4) % 7; 1.428 + return( weekday < 0 ? 7 + weekday : weekday ); 1.429 +} 1.430 + 1.431 +// missing daylight savins time adjustment 1.432 + 1.433 +function HourFromTime( t ) { 1.434 + var h = Math.floor( t / msPerHour ) % HoursPerDay; 1.435 + return ( (h<0) ? HoursPerDay + h : h ); 1.436 +} 1.437 +function MinFromTime( t ) { 1.438 + var min = Math.floor( t / msPerMinute ) % MinutesPerHour; 1.439 + return( ( min < 0 ) ? MinutesPerHour + min : min ); 1.440 +} 1.441 +function SecFromTime( t ) { 1.442 + var sec = Math.floor( t / msPerSecond ) % SecondsPerMinute; 1.443 + return ( (sec < 0 ) ? SecondsPerMinute + sec : sec ); 1.444 +} 1.445 +function msFromTime( t ) { 1.446 + var ms = t % msPerSecond; 1.447 + return ( (ms < 0 ) ? msPerSecond + ms : ms ); 1.448 +} 1.449 +function LocalTZA() { 1.450 + return ( TZ_DIFF * msPerHour ); 1.451 +} 1.452 +function UTC( t ) { 1.453 + return ( t - LocalTZA() - DaylightSavingTA(t - LocalTZA()) ); 1.454 +} 1.455 +function DaylightSavingTA( t ) { 1.456 + t = t - LocalTZA(); 1.457 + 1.458 + var dst_start = GetFirstSundayInApril(t) + 2*msPerHour; 1.459 + var dst_end = GetLastSundayInOctober(t)+ 2*msPerHour; 1.460 + 1.461 + if ( t >= dst_start && t < dst_end ) { 1.462 + return msPerHour; 1.463 + } else { 1.464 + return 0; 1.465 + } 1.466 + 1.467 + // Daylight Savings Time starts on the first Sunday in April at 2:00AM in 1.468 + // PST. Other time zones will need to override this function. 1.469 + 1.470 + print( new Date( UTC(dst_start + LocalTZA())) ); 1.471 + 1.472 + return UTC(dst_start + LocalTZA()); 1.473 +} 1.474 +function GetFirstSundayInApril( t ) { 1.475 + var year = YearFromTime(t); 1.476 + var leap = InLeapYear(t); 1.477 + 1.478 + var april = TimeFromYear(year) + TimeInMonth(0, leap) + TimeInMonth(1,leap) + 1.479 + TimeInMonth(2,leap); 1.480 + 1.481 + for ( var first_sunday = april; WeekDay(first_sunday) > 0; 1.482 + first_sunday += msPerDay ) 1.483 + { 1.484 + ; 1.485 + } 1.486 + 1.487 + return first_sunday; 1.488 +} 1.489 +function GetLastSundayInOctober( t ) { 1.490 + var year = YearFromTime(t); 1.491 + var leap = InLeapYear(t); 1.492 + 1.493 + for ( var oct = TimeFromYear(year), m = 0; m < 9; m++ ) { 1.494 + oct += TimeInMonth(m, leap); 1.495 + } 1.496 + for ( var last_sunday = oct + 30*msPerDay; WeekDay(last_sunday) > 0; 1.497 + last_sunday -= msPerDay ) 1.498 + { 1.499 + ; 1.500 + } 1.501 + return last_sunday; 1.502 +} 1.503 +function LocalTime( t ) { 1.504 + return ( t + LocalTZA() + DaylightSavingTA(t) ); 1.505 +} 1.506 +function MakeTime( hour, min, sec, ms ) { 1.507 + if ( isNaN( hour ) || isNaN( min ) || isNaN( sec ) || isNaN( ms ) ) { 1.508 + return Number.NaN; 1.509 + } 1.510 + 1.511 + hour = ToInteger(hour); 1.512 + min = ToInteger( min); 1.513 + sec = ToInteger( sec); 1.514 + ms = ToInteger( ms ); 1.515 + 1.516 + return( (hour*msPerHour) + (min*msPerMinute) + 1.517 + (sec*msPerSecond) + ms ); 1.518 +} 1.519 +function MakeDay( year, month, date ) { 1.520 + if ( isNaN(year) || isNaN(month) || isNaN(date) ) { 1.521 + return Number.NaN; 1.522 + } 1.523 + year = ToInteger(year); 1.524 + month = ToInteger(month); 1.525 + date = ToInteger(date ); 1.526 + 1.527 + var sign = ( year < 1970 ) ? -1 : 1; 1.528 + var t = ( year < 1970 ) ? 1 : 0; 1.529 + var y = ( year < 1970 ) ? 1969 : 1970; 1.530 + 1.531 + var result5 = year + Math.floor( month/12 ); 1.532 + var result6 = month % 12; 1.533 + 1.534 + if ( year < 1970 ) { 1.535 + for ( y = 1969; y >= year; y += sign ) { 1.536 + t += sign * TimeInYear(y); 1.537 + } 1.538 + } else { 1.539 + for ( y = 1970 ; y < year; y += sign ) { 1.540 + t += sign * TimeInYear(y); 1.541 + } 1.542 + } 1.543 + 1.544 + var leap = InLeapYear( t ); 1.545 + 1.546 + for ( var m = 0; m < month; m++ ) { 1.547 + t += TimeInMonth( m, leap ); 1.548 + } 1.549 + 1.550 + if ( YearFromTime(t) != result5 ) { 1.551 + return Number.NaN; 1.552 + } 1.553 + if ( MonthFromTime(t) != result6 ) { 1.554 + return Number.NaN; 1.555 + } 1.556 + if ( DateFromTime(t) != 1 ) { 1.557 + return Number.NaN; 1.558 + } 1.559 + 1.560 + return ( (Day(t)) + date - 1 ); 1.561 +} 1.562 +function TimeInMonth( month, leap ) { 1.563 + // september april june november 1.564 + // jan 0 feb 1 mar 2 apr 3 may 4 june 5 jul 6 1.565 + // aug 7 sep 8 oct 9 nov 10 dec 11 1.566 + 1.567 + if ( month == 3 || month == 5 || month == 8 || month == 10 ) { 1.568 + return ( 30*msPerDay ); 1.569 + } 1.570 + 1.571 + // all the rest 1.572 + if ( month == 0 || month == 2 || month == 4 || month == 6 || 1.573 + month == 7 || month == 9 || month == 11 ) { 1.574 + return ( 31*msPerDay ); 1.575 + } 1.576 + 1.577 + // save february 1.578 + return ( (leap == 0) ? 28*msPerDay : 29*msPerDay ); 1.579 +} 1.580 +function MakeDate( day, time ) { 1.581 + if ( day == Number.POSITIVE_INFINITY || 1.582 + day == Number.NEGATIVE_INFINITY || 1.583 + day == Number.NaN ) { 1.584 + return Number.NaN; 1.585 + } 1.586 + if ( time == Number.POSITIVE_INFINITY || 1.587 + time == Number.POSITIVE_INFINITY || 1.588 + day == Number.NaN) { 1.589 + return Number.NaN; 1.590 + } 1.591 + return ( day * msPerDay ) + time; 1.592 +} 1.593 +function TimeClip( t ) { 1.594 + if ( isNaN( t ) ) { 1.595 + return ( Number.NaN ); 1.596 + } 1.597 + if ( Math.abs( t ) > 8.64e15 ) { 1.598 + return ( Number.NaN ); 1.599 + } 1.600 + 1.601 + return ( ToInteger( t ) ); 1.602 +} 1.603 +function ToInteger( t ) { 1.604 + t = Number( t ); 1.605 + 1.606 + if ( isNaN( t ) ){ 1.607 + return ( Number.NaN ); 1.608 + } 1.609 + if ( t == 0 || t == -0 || 1.610 + t == Number.POSITIVE_INFINITY || t == Number.NEGATIVE_INFINITY ) { 1.611 + return 0; 1.612 + } 1.613 + 1.614 + var sign = ( t < 0 ) ? -1 : 1; 1.615 + 1.616 + return ( sign * Math.floor( Math.abs( t ) ) ); 1.617 +} 1.618 +function Enumerate ( o ) { 1.619 + var properties = new Array(); 1.620 + for ( p in o ) { 1.621 + properties[ properties.length ] = new Array( p, o[p] ); 1.622 + } 1.623 + return properties; 1.624 +} 1.625 +function AddTestCase( description, expect, actual ) { 1.626 + testcases[tc++] = new TestCase( SECTION, description, expect, actual ); 1.627 +} 1.628 + 1.629 +function getFailedCases() { 1.630 + for ( var i = 0; i < testcases.length; i++ ) { 1.631 + if ( ! testcases[i].passed ) { 1.632 + print( testcases[i].description +" = " +testcases[i].actual +" expected: "+ testcases[i].expect ); 1.633 + } 1.634 + } 1.635 +}