Skip to content

Conversation

@locker
Copy link
Member

@locker locker commented Nov 26, 2025

Treating arrays as maps in assert_covers is error-prone so we fixed it in commit 95a1c3f ("Fix assert_covers treat arrays as maps"), but we did it over-zealously - now arrays are treated just like scalars (numbers, for example). This breaks the case when array items are supposed to be checked for coverage for example:

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

Fix this.

Follow-up #405
Closes #439

Treating arrays as maps in `assert_covers` is error-prone so we fixed it
in commit 95a1c3f ("Fix `assert_covers` treat arrays as maps"), but
we did it over-zealously - now arrays are treated just like scalars
(numbers, for example). This breaks the case when array items are
supposed to be checked for coverage for example:

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

Fix this.

Follow-up tarantool#405
Closes tarantool#439
@locker locker merged commit 53ec103 into tarantool:master Nov 26, 2025
8 checks passed
@locker locker deleted the assert-covers-fix branch November 26, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

assert_covers is too strict when checking arrays

2 participants