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
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2

@ -15,16 +15,12 @@ local function get_string(test_name)
end end
local epsilon = 0.000001 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 for node_id, node_name in pairs(idmap) do
assert.are.same("number", type(node_id)) assert.are.same("number", type(node_id))
assert.are.same("string", type(node_name)) assert.are.same("string", type(node_name))
assert.is_true(node_id - math.floor(node_id) < epsilon) assert.is_true(node_id - math.floor(node_id) < epsilon)
if is_delta then assert.is_true(node_id >= 0)
assert.is_true(node_id >= -2)
else
assert.is_true(node_id >= -1)
end
end end
end end