mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-27 01:13:00 +00:00
tests/weaschem: correct tests for parse_id_map
This commit is contained in:
parent
7384f1dbbb
commit
6f35ff3313
1 changed files with 2 additions and 6 deletions
|
@ -15,16 +15,12 @@ local function get_string(test_name)
|
|||
end
|
||||
|
||||
local epsilon = 0.000001
|
||||
local function validate_id_map(idmap, is_delta)
|
||||
local function validate_id_map(idmap)
|
||||
for node_id, node_name in pairs(idmap) do
|
||||
assert.are.same("number", type(node_id))
|
||||
assert.are.same("string", type(node_name))
|
||||
assert.is_true(node_id - math.floor(node_id) < epsilon)
|
||||
if is_delta then
|
||||
assert.is_true(node_id >= -2)
|
||||
else
|
||||
assert.is_true(node_id >= -1)
|
||||
end
|
||||
assert.is_true(node_id >= 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue