forked from tarantool/tarantool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: replace testcase by luatest's testcases
The tests `array.test.lua` and `map.test.lua` require the remote Tarantool instance for running testcases. When tests are executed by test-run.py, it runs this Tarantool instance. The testcases that require the remote instance were ported to luatest to make tests able to run with ctest. The testcases `builtins-13.1` and `builtins-14.1` are companion testcases and were moved as well. Required by patches for CTest support, because allows to execute aforementioned tests without test-run.py. NO_CHANGELOG=codehealth NO_DOC=codehealth NO_TEST=codehealth
- Loading branch information
Showing
4 changed files
with
50 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
local server = require('luatest.server') | ||
local t = require('luatest') | ||
|
||
local g = t.group() | ||
|
||
g.before_all(function() | ||
g.server = server:new({alias = 'array'}) | ||
g.server:start() | ||
end) | ||
|
||
g.after_all(function() | ||
g.server:stop() | ||
end) | ||
|
||
-- Make sure that ARRAY values can be used as bound variable. | ||
g.test_array_binding_local = function() | ||
g.server:exec(function() | ||
local sql = [[SELECT #a;]] | ||
local arg = {{['#a'] = {1, 2, 3}}} | ||
t.assert_equals(box.execute(sql, arg).rows[1][1], {1, 2, 3}) | ||
end) | ||
end | ||
|
||
g.test_array_binding_remote = function() | ||
local conn = g.server.net_box | ||
local ok, res = pcall(conn.execute, conn, [[SELECT #a;]], | ||
{{['#a'] = {1, 2, 3}}}) | ||
t.assert_equals(ok, true) | ||
t.assert_equals(res.rows[1][1], {1, 2, 3}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters