tests/weaschem: correct tests for parse_id_map

This commit is contained in:
Starbeamrainbowlabs 2023-08-18 15:01:17 +01:00
parent 7384f1dbbb
commit 6f35ff3313
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -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