Skip to content

Commit

Permalink
Clean up, check first/last items explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
lethosor committed Apr 1, 2022
1 parent 8679e50 commit f6fe6fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/structures/enum_attrs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ end
function test.valid_items()
for i in ipairs(df.item_type) do
check_valid_attr_entry(df.item_type, i)
-- expect.true_(df.item_type.attrs[i])
-- expect.true_(df.item_type._attr_entry_type:is_instance(df.item_type.attrs[i]))
end
check_valid_attr_entry(df.item_type, df.item_type._first_item)
check_valid_attr_entry(df.item_type, df.item_type._last_item)
end

function test.valid_items_name()
Expand Down Expand Up @@ -62,7 +62,7 @@ function test.pairs()
break
end
end
expect.eq(i, 0)
expect.eq(i, 0, 'pairs() returned wrong number of items')
end

function test.ipairs()
Expand All @@ -79,5 +79,5 @@ function test.ipairs()
expect.eq(value, df.item_type.attrs[i + df.item_type._first_item],
'ipairs() returned incorrect attrs for item at index: ' .. tostring(index))
end
expect.eq(i, max_attrs_length(df.item_type))
expect.eq(i, max_attrs_length(df.item_type), 'ipairs() returned wrong number of items')
end

0 comments on commit f6fe6fb

Please sign in to comment.