Skip to content

assert_covers is too strict when checking arrays #439

@locker

Description

@locker

The problem is that assert_covers now treats arrays as plain scalars while it may be convenient to check that array items cover expected values:

t.assert_covers({
    {a = 1, b = 10},
    {a = 2, b = 20},
    {a = 3, b = 30},
}, {{a = 1}, {a = 2}, {a = 3}})

This used to work now but was broken by commit 95a1c3f (merged into luatest 1.3.0), which attempted to fix #405.

What we want to ensure here is that the number of items in both arrays is the same and each item covers the corresponding expected item.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions