Skip to content

Commit

Permalink
Compress test file slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 20, 2024
1 parent fb26ab9 commit 9f36f56
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lua/src/lib/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local function get_answer(id)
local type_ = row[2]
local length = tonumber(row[3])
local value = row[4]

if type_ == 'str' then
return value
elseif type_ == 'int' then
Expand Down
29 changes: 14 additions & 15 deletions lua/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,27 @@ end
local get_answer = loadlib("utils").get_answer

-- Problems configuration: filename -> {expected_answer, is_slow}
local problems = {
["p0001.lua"] = {get_answer(1), false},
["p0002.lua"] = {get_answer(2), false},
["p0003.lua"] = {get_answer(3), false},
["p0004.lua"] = {get_answer(4), false},
["p0005.lua"] = {get_answer(5), false},
["p0006.lua"] = {get_answer(6), false},
["p0007.lua"] = {get_answer(7), false},
["p0008.lua"] = {get_answer(8), false},
["p0009.lua"] = {get_answer(9), false},
["p0010.lua"] = {get_answer(10), false},
["p0011.lua"] = {get_answer(11), false},
["p0013.lua"] = {get_answer(13), false},
["p0014.lua"] = {get_answer(14), false},
["p0015.lua"] = {get_answer(15), false},
local problems = {}

for i = 1, 11 do
problems[string.format("p%04d.lua", i)] = {get_answer(i), false}
end
for i = 13, 15 do
problems[string.format("p%04d.lua", i)] = {get_answer(i), false}
end

local more_problems = {
["p0017.lua"] = {get_answer(17), false},
["p0028.lua"] = {get_answer(28), false},
["p0034.lua"] = {get_answer(34), false},
["p0076.lua"] = {get_answer(76), true},
["p0836.lua"] = {get_answer(836), false},
}

for _, v in ipairs(more_problems) do
table.insert(problems, v)
end

-- Fast testing loop
for file_name, config in pairs(problems) do
if not config[2] then
Expand Down

0 comments on commit 9f36f56

Please sign in to comment.