Commit 53ec103
committed
Make
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 #405
Closes #439assert_covers check array items for coverage1 parent 731ba6f commit 53ec103
3 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
| 446 | + | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
449 | 451 | | |
450 | | - | |
451 | | - | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| |||
0 commit comments