diff --git a/harness/compareArray.js b/harness/compareArray.js index 6eb69e6eba012ddc1a1d25f81cbeb4d1b2398111..0e0654aeb4e1a69e8f382342b0c852d6acc74095 100644 --- a/harness/compareArray.js +++ b/harness/compareArray.js @@ -13,3 +13,17 @@ function compareArray(a, b) { return true; } +assert.compareArray = function(actual, expected, message) { + if (compareArray(actual, expected)) return; + + + if (message === undefined) { + message = ''; + } else { + message += ' '; + } + + message += 'Expected SameValue(«' + String(actual) + '», «' + String(expected) + '») to be true'; + + $ERROR(`${message}${message === undefined ? '' : ' '}Expected the arrays [${actual}] to have the same contents as [${expected}]`); +}