From 1388a2830ca61532445eea7a970380b6b000581c Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 19 Jun 2021 01:53:32 -0400 Subject: [PATCH] Also check start index of ipairs() --- test/structures/enum_attrs.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/structures/enum_attrs.lua b/test/structures/enum_attrs.lua index c86461d58d9..9b67145529b 100644 --- a/test/structures/enum_attrs.lua +++ b/test/structures/enum_attrs.lua @@ -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))