Commit a48034a
test: fix luaunit/assertions_error_test for Tarantool 3.2 and newer
With Tarantool 3.2 and newer the test fails with:
```
...luatest/test/luaunit/assertions_error_test.lua:244: Unexpected error trace,
expected: {file = "/home/runner/work/luatest/luatest/luatest/assertions.lua", line = 102},
actual: {
file = "...k/luatest/luatest/test/luaunit/assertions_error_test.lua",
line = 236,
}
```
On older Tarantool versions the error trace isn't checked because
`tarantool._internal.trace_check_is_required` isn't defined there.
Tarantool 3.2 is the first version that defines this internal function.
Since `error.raise` used by the test resides in 'builtin/error.lua',
stack trace checking is enabled for this function.
The problem is `error.raise()` does not change the original error trace
while `t.assert_error_covers()` expects the trace to point to the place
where `error.raise()` was invoked. Let's use `box.error()` instead so
the new error has the expected trace.
Also change `box.error.ILLEGAL_PARAMS` to `box.error.UNSUPPORTED` for
the check to pass because in Tarantool 3.2 the former was changed to
`{type = 'IllegalParams'}`.1 parent e251105 commit a48034a
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| |||
0 commit comments