Skip to content

Commit 871ba45

Browse files
committed
test: adjust tarantool version parsing for 2.10.0+
The test was confused by the entrypoint/alpha/beta/rc suffixes in the version string (see [1] about those suffixes). Now they're ignored. It is not perfectly correct (2.10.0-rc1 is less than 2.10.0), but enough for this test. [1]: tarantool/tarantool#6182 Part of #21
1 parent 946466d commit 871ba45

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/tuple_keydef.test.lua

+5-8
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ local function parse_tarantool_version(component)
1212
-- version, on which it is based, in the first four components
1313
-- (as well as in the commit hash).
1414
--
15-
-- So we ignore everything after 4th component.
16-
local pattern = '^(%d+).(%d+).(%d+)-(%d+)-g[0-9a-f]+'
15+
-- We don't use version components behind the first three
16+
-- ones in the testing code for simplicity. We also ignore
17+
-- alpha/beta/rc suffixes for the same reason.
18+
local pattern = '^(%d+)%.(%d+)%.(%d+)'
1719
return tonumber((select(component, _TARANTOOL:match(pattern))))
1820
end
1921

2022
local _TARANTOOL_MAJOR = parse_tarantool_version(1)
2123
local _TARANTOOL_MINOR = parse_tarantool_version(2)
2224
local _TARANTOOL_PATCH = parse_tarantool_version(3)
23-
local _TARANTOOL_REV = parse_tarantool_version(4)
2425

25-
local function tarantool_version_at_least(major, minor, patch, rev)
26+
local function tarantool_version_at_least(major, minor, patch)
2627
local major = major or 0
2728
local minor = minor or 0
2829
local patch = patch or 0
29-
local rev = rev or 0
3030

3131
if _TARANTOOL_MAJOR < major then return false end
3232
if _TARANTOOL_MAJOR > major then return true end
@@ -37,9 +37,6 @@ local function tarantool_version_at_least(major, minor, patch, rev)
3737
if _TARANTOOL_PATCH < patch then return false end
3838
if _TARANTOOL_PATCH > patch then return true end
3939

40-
if _TARANTOOL_REV < rev then return false end
41-
if _TARANTOOL_REV > rev then return true end
42-
4340
return true
4441
end
4542

0 commit comments

Comments
 (0)