summaryrefslogtreecommitdiff
path: root/website/harness/compareArray.js
diff options
context:
space:
mode:
Diffstat (limited to 'website/harness/compareArray.js')
-rw-r--r--website/harness/compareArray.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/website/harness/compareArray.js b/website/harness/compareArray.js
new file mode 100644
index 000000000..9b842ed5c
--- /dev/null
+++ b/website/harness/compareArray.js
@@ -0,0 +1,19 @@
+
+//-----------------------------------------------------------------------------
+function compareArray(aExpected, aActual) {
+ if (aActual.length != aExpected.length) {
+ return false;
+ }
+
+ aExpected.sort();
+ aActual.sort();
+
+ var s;
+ for (var i = 0; i < aExpected.length; i++) {
+ if (aActual[i] !== aExpected[i]) {
+ return false;
+ }
+ }
+ return true;
+}
+