Skip to content

Commit

Permalink
Also check start index of ipairs()
Browse files Browse the repository at this point in the history
  • Loading branch information
lethosor committed Apr 1, 2022
1 parent 9b09788 commit 1388a28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/structures/enum_attrs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ end

function test.ipairs()
local i = 0
for _ in ipairs(df.item_type.attrs) do
for index in ipairs(df.item_type.attrs) do
if i == 0 then
expect.eq(index, df.item_type._first_item, 'ipairs() returned wrong start index')
end
i = i + 1
if i > max_attrs_length(df.item_type) then
expect.fail('ipairs() returned too many items: ' .. tostring(i))
Expand Down

0 comments on commit 1388a28

Please sign in to comment.