aboutsummaryrefslogtreecommitdiff
path: root/utils.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-01-26 20:20:12 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2018-01-26 20:20:38 -0800
commit90c56d31352a0eeccd382ef5921baf3af4971040 (patch)
tree5167eafb5785c94b48458b18b0454222ca70c749 /utils.lua
parentd5aa4e52983712f9f4c5b23528d0c2dab12b0b33 (diff)
Added a ton of tests for virtually all the functionality. Helped me find
and fix a lot of latent problems.
Diffstat (limited to 'utils.lua')
-rw-r--r--utils.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils.lua b/utils.lua
index 80585a5..937252f 100644
--- a/utils.lua
+++ b/utils.lua
@@ -284,7 +284,7 @@ local function sort(list, keyFn, reverse)
end
local function equivalent(x, y, depth)
- depth = depth or 1
+ depth = depth or -1
if x == y then
return true
end
@@ -296,6 +296,8 @@ local function equivalent(x, y, depth)
end
if depth == 0 then
return false
+ elseif depth < -999 then
+ error("Exceeded maximum comparison depth")
end
local checked = {}
for k, v in pairs(x) do