tarantool / tarantool/luatest

Add an ability to use `assert_items_include` with tuples

Open
#331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
41
Forks
13
PR merge metrics
No merged PRs in 30d

Description

local t = require('luatest')
local g = t.group()

local a = {1,2,3}
local b = box.tuple.new(a)
local c = box.tuple.new(a)

-- unable to assert table with tuple
g.test_table_includes_tuple = function()
    t.assert_items_include(a, b)
end
-- even unable to assert tuple with tuple
g.test_tuple_includes_tuple = function()
    t.assert_items_include(b, c)
end
$ .rocks/bin/luatest ./test
Tarantool version is 2.11.0-0-gc9673ebb7-r575-gc64
FF

Failed tests:
-------------

1) tuples_assert.test_table_includes_tuple
...ge4a/tmp/assert-tuples/app///test/tuples_assert_test.lua:10: Expected all item values from: [1, 2, 3]
To be present in: {1, 2, 3}
stack traceback:
	...ge4a/tmp/assert-tuples/app///test/tuples_assert_test.lua:10: in function 'tuples_assert.test_table_includes_tuple'
	...
	[C]: in function 'xpcall'
2) tuples_assert.test_tuple_includes_tuple
...ge4a/tmp/assert-tuples/app///test/tuples_assert_test.lua:14: Expected all item values from: [1, 2, 3]
To be present in: [1, 2, 3]
stack traceback:
	...ge4a/tmp/assert-tuples/app///test/tuples_assert_test.lua:14: in function 'tuples_assert.test_tuple_includes_tuple'
	...
	[C]: in function 'xpcall'
Ran 2 tests in 0.001 seconds, 0 succeeded, 2 failed

Failed tests:

tuples_assert.test_table_includes_tuple
tuples_assert.test_tuple_includes_tuple

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the assert_items_include entry point and reproduce the two cases shown with a table containing a tuple and with two tuples. Add regression coverage for both combinations and verify that the assertions pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.