Compare commits

..

2 commits

Author SHA1 Message Date
87f018ceea comments 2024-12-02 14:05:55 -08:00
375246159d remove testing 2024-12-02 11:59:29 -08:00

View file

@ -98,6 +98,7 @@ local function is_safe(report)
return unsafe, unsafe_idx_1, unsafe_idx_2 return unsafe, unsafe_idx_1, unsafe_idx_2
end end
-- Copy the report, remove the specified index, and test if it is safe
local function test_altered_report(report, idx) local function test_altered_report(report, idx)
local test_report = table.shallow_copy(report) local test_report = table.shallow_copy(report)
table.remove(test_report, idx) table.remove(test_report, idx)
@ -107,9 +108,11 @@ end
local safe_count = 0 local safe_count = 0
for _, report in ipairs(reports) do for _, report in ipairs(reports) do
-- if unsafe == true, idx1 and idx2 will be null
local unsafe, idx1, idx2 = is_safe(report) local unsafe, idx1, idx2 = is_safe(report)
if unsafe then if unsafe then
-- if the report is unsafe, generate 2 reports with the potentially bad values removed, and test them again
if not test_altered_report(report, idx1) or not test_altered_report(report, idx2) then if not test_altered_report(report, idx1) or not test_altered_report(report, idx2) then
unsafe = false unsafe = false
end end
@ -121,11 +124,3 @@ for _, report in ipairs(reports) do
end end
print(safe_count) print(safe_count)
local function test()
return true, nil, nil
end
if test() then
print("uwu")
end