forked from DFHack/dfhack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathother_vectors.lua
More file actions
26 lines (23 loc) · 844 Bytes
/
Copy pathother_vectors.lua
File metadata and controls
26 lines (23 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function test.index_name()
for _, k in ipairs(df.units_other_id) do
expect.eq(df.global.world.units.other[k]._kind, 'container')
end
end
function test.index_name_bad()
expect.error_match('not found.$', function()
expect.eq(df.global.world.units.other.SOME_FAKE_NAME, 'container')
end)
end
function test.index_id()
for i in ipairs(df.units_other_id) do
expect.eq(df.global.world.units.other[i]._kind, 'container', df.units_other_id[i])
end
end
function test.index_id_bad()
expect.error_match('Cannot read field', function()
expect.eq(df.global.world.units.other[df.units_other_id._first_item - 1], 'container')
end)
expect.error_match('Cannot read field', function()
expect.eq(df.global.world.units.other[df.units_other_id._last_item + 1], 'container')
end)
end