Skip to content
Snippets Groups Projects
Commit b359a021 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[sql-hint tests] Fix result comparision function

Issue #4618
parent d333c723
No related branches found
No related tags found
No related merge requests found
......@@ -144,7 +144,7 @@
value: "SELECT myt",
cursor: Pos(0, 10),
tables: displayTextTables,
list: displayTextTables,
list: [{text: "mytable", displayText: "mytable | The main table",}],
from: Pos(0, 7),
to: Pos(0, 10)
});
......@@ -179,11 +179,18 @@
})
function deepCompare(a, b) {
if (!a || typeof a != "object")
return a === b;
if (!b || typeof b != "object")
return false;
for (var prop in a) if (!deepCompare(a[prop], b[prop])) return false;
return true;
if (a === b) return true
if (!(a && typeof a == "object") ||
!(b && typeof b == "object")) return false
let array = Array.isArray(a)
if (Array.isArray(b) != array) return false
if (array) {
if (a.length != b.length) return false
for (let i = 0; i < a.length; i++) if (!deepCompare(a[i], b[i])) return false
} else {
for (let p in a) if (!(p in b) || !deepCompare(a[p], b[p])) return false
for (let p in b) if (!(p in a)) return false
}
return true
}
})();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment