Skip to content

Commit

Permalink
test: fix RW register testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
ligurio committed Nov 7, 2024
1 parent fcb07ac commit e728b08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/tests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@ test:test('tests.rw_register_gen', function(test)
test:is(n, num, "tests.rw_register_gen(): length")

local gen, param, state = tests.rw_register_gen()
local _, op_func, _ = gen(param, state)
local op = op_func()
local _, op, _ = gen(param, state)
op = type(op) == 'function' and op() or op
local mop = op.value[1]
test:is(type(mop), 'table', "tests.rw_register_gen(): mop")
local mop_key = mop[IDX_MOP_KEY]
test:is(type(mop_key), 'string', "tests.rw_register_gen(): mop key")
local mop_type = mop[IDX_MOP_TYPE]
test:is(mop_type == 'r' or mop_type == 'append', true, "tests.rw_register_gen(): mop type")
test:is(mop_type == 'r' or mop_type == 'w', true, "tests.rw_register_gen(): mop type")
local mop_val = mop[IDX_MOP_VAL]
test:is(mop_val == 'number' or mop_val == json.NULL, true, "tests.rw_register_gen(): mop value")
test:is(type(mop_val) == 'number' or mop_val == json.NULL, true, "tests.rw_register_gen(): mop value")
end)

test:test('tests.list_append_gen', function(test)
Expand Down

0 comments on commit e728b08

Please sign in to comment.