From 90c56d31352a0eeccd382ef5921baf3af4971040 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 26 Jan 2018 20:20:12 -0800 Subject: Added a ton of tests for virtually all the functionality. Helped me find and fix a lot of latent problems. --- utils.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'utils.lua') 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 -- cgit v1.2.3