Skip to content

Commit dcd0934

Browse files
nshyoleg-jukovec
authored andcommitted
test: use coverage instead of equality to test error payload 2
We are going to add missing 'user' payload field for ACCESS_DENIED error which will break current tests. Let fix tests to allow adding new payload fields for errors. This is another place where we test for payload equality. Need for tarantool/tarantool#9108
1 parent 3f44945 commit dcd0934

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

config.lua

+3-4
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ if tarantool_version_at_least(2, 4, 1) then
248248
-- - file: val
249249
-- line: val
250250

251-
local function compare_box_error_attributes(expected, actual, attr_provider)
252-
for attr, _ in pairs(attr_provider:unpack()) do
251+
local function compare_box_error_attributes(expected, actual)
252+
for attr, _ in pairs(expected:unpack()) do
253253
if (attr ~= 'prev') and (attr ~= 'trace') then
254254
if expected[attr] ~= actual[attr] then
255255
error(('%s expected %s is not equal to actual %s'):format(
@@ -272,8 +272,7 @@ if tarantool_version_at_least(2, 4, 1) then
272272
expected.type, expected.message))
273273
end
274274

275-
compare_box_error_attributes(expected, actual, expected)
276-
compare_box_error_attributes(expected, actual, actual)
275+
compare_box_error_attributes(expected, actual)
277276

278277
if (expected.prev ~= nil) or (actual.prev ~= nil) then
279278
return compare_box_errors(expected.prev, actual.prev)

0 commit comments

Comments
 (0)