325,7 → 325,7 |
* Asserts that two arrays are equal. If they are not, |
* an {@link #AssertionError} is thrown with a default message. |
* Two arrays are considered equal only if their elements are |
* strictly equal (shallow strict comparison). |
* strictly equal (shallow or deep strict comparison). |
* |
* @function |
* @throws |
349,13 → 349,26 |
* Expected value; if a string, it is evaluated as a <i>Program</i>. |
* @param {string|Array} actuals |
* Actual value; if a string, it is evaluated as a <i>Program</i>. |
* @param {number} depth |
* If <code>undefined</code> (default), shallow comparison |
* is performed. If not <code>0</code>, deep comparison |
* is performed: if less than <code>0</code>, there is |
* no limit as to the depth of the comparison; if greater |
* than <code>0</code>, items are compared down to the |
* specified depth. |
* @param {boolean} recursive |
* Used internally to detect recursive assertions |
* @return {boolean} |
* <code>false</code>, if comparison is not possible |
* or the assertion fails, and no exception can be thrown; |
* <code>true</code>, if the assertion is met. |
*/ |
return function (expecteds, actuals) { |
return ( |
function jsx_test_assertArrayEquals (expecteds, actuals, depth, recursive) { |
if (!recursive) |
{ |
_increaseAssertCount(); |
} |
|
if (typeof expecteds == "string") |
{ |
388,14 → 401,24 |
|
for (var i = len; i--;) |
{ |
if (expecteds[i] !== actuals[i]) |
var recursive = (typeof depth == "number" && depth != 0); |
var expected = expecteds[i]; |
var actual = actuals[i]; |
|
if (recursive && _isArray(expected) && _isArray(actual)) |
{ |
var new_level = ((depth < 0) ? depth : (depth - 1)); |
jsx_test_assertArrayEquals(expected, actual, new_level, true); |
} |
else if (expected !== actual) |
{ |
return _thrower(expecteds, actuals); |
} |
} |
|
return true; |
}; |
} |
); |
}()), |
|
/** |