[Tarantool-patches] [PATCH v1 1/1] tests: simplify test box/access_mist.test.lua

imeevma at tarantool.org imeevma at tarantool.org
Sat Oct 19 13:30:36 MSK 2019


Currently, the test shows all the data that is contained in _func
space. This is inconvenient, as some data changes every time you
create bootstrap.span. In this regard, we have to update test
result-file. After this patch, the test will show only part of the
data.
---
https://github.com/tarantool/tarantool/tree/imeevma/small_fixes

 test/box/access_misc.result   | 346 +++++++++++++++++++++++++-----------------
 test/box/access_misc.test.lua |   4 +-
 2 files changed, 212 insertions(+), 138 deletions(-)

diff --git a/test/box/access_misc.result b/test/box/access_misc.result
index 27eb47a..b60c63f 100644
--- a/test/box/access_misc.result
+++ b/test/box/access_misc.result
@@ -837,143 +837,215 @@ box.space._space:select()
   - [372, 1, '_func_index', 'memtx', 0, {}, [{'name': 'space_id', 'type': 'unsigned'},
       {'name': 'index_id', 'type': 'unsigned'}, {'name': 'func_id', 'type': 'unsigned'}]]
 ...
-box.space._func:select()
----
-- - [1, 1, 'box.schema.user.info', 1, 'LUA', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, ['LUA'], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [2, 1, 'TRIM', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [3, 1, 'TYPEOF', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [4, 1, 'PRINTF', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [5, 1, 'UNICODE', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [6, 1, 'CHAR', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [7, 1, 'HEX', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [8, 1, 'VERSION', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [9, 1, 'QUOTE', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [10, 1, 'REPLACE', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [11, 1, 'SUBSTR', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [12, 1, 'GROUP_CONCAT', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [13, 1, 'JULIANDAY', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [14, 1, 'DATE', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [15, 1, 'TIME', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [16, 1, 'DATETIME', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [17, 1, 'STRFTIME', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [18, 1, 'CURRENT_TIME', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [19, 1, 'CURRENT_TIMESTAMP', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none',
-    'none', false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [20, 1, 'CURRENT_DATE', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [21, 1, 'LENGTH', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [22, 1, 'POSITION', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [23, 1, 'ROUND', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [24, 1, 'UPPER', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [25, 1, 'LOWER', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [26, 1, 'IFNULL', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [27, 1, 'RANDOM', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [28, 1, 'CEIL', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [29, 1, 'CEILING', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [30, 1, 'CHARACTER_LENGTH', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none',
-    'none', false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [31, 1, 'CHAR_LENGTH', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [32, 1, 'FLOOR', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [33, 1, 'MOD', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [34, 1, 'OCTET_LENGTH', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [35, 1, 'ROW_COUNT', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [36, 1, 'COUNT', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [37, 1, 'LIKE', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [38, 1, 'ABS', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [39, 1, 'EXP', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [40, 1, 'LN', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [41, 1, 'POWER', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [42, 1, 'SQRT', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [43, 1, 'SUM', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [44, 1, 'TOTAL', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [45, 1, 'AVG', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [46, 1, 'RANDOMBLOB', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [47, 1, 'NULLIF', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [48, 1, 'ZEROBLOB', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [49, 1, 'MIN', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [50, 1, 'MAX', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [51, 1, 'COALESCE', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [52, 1, 'EVERY', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [53, 1, 'EXISTS', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [54, 1, 'EXTRACT', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [55, 1, 'SOME', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none', false,
-    false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [56, 1, 'GREATER', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [57, 1, 'LESSER', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [58, 1, 'SOUNDEX', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [59, 1, 'LIKELIHOOD', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [60, 1, 'LIKELY', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [61, 1, 'UNLIKELY', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [62, 1, '_sql_stat_get', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none',
-    'none', false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [63, 1, '_sql_stat_push', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none',
-    'none', false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [64, 1, '_sql_stat_init', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none',
-    'none', false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [65, 1, 'LUA', 1, 'LUA', 'function(code) return assert(loadstring(code))() end',
-    'function', ['string'], 'any', 'none', 'none', false, false, true, ['LUA', 'SQL'],
-    {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [66, 1, 'GREATEST', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
-  - [67, 1, 'LEAST', 1, 'SQL_BUILTIN', '', 'function', [], 'any', 'none', 'none',
-    false, false, true, [], {}, '', '2019-10-07 13:46:37', '2019-10-07 13:46:37']
+funcs = {}
+---
+...
+for _, v in box.space._func:pairs() do table.insert(funcs, {v.id, v.name, v.language}) end
+---
+...
+funcs
+---
+- - - 1
+    - box.schema.user.info
+    - LUA
+  - - 2
+    - TRIM
+    - SQL_BUILTIN
+  - - 3
+    - TYPEOF
+    - SQL_BUILTIN
+  - - 4
+    - PRINTF
+    - SQL_BUILTIN
+  - - 5
+    - UNICODE
+    - SQL_BUILTIN
+  - - 6
+    - CHAR
+    - SQL_BUILTIN
+  - - 7
+    - HEX
+    - SQL_BUILTIN
+  - - 8
+    - VERSION
+    - SQL_BUILTIN
+  - - 9
+    - QUOTE
+    - SQL_BUILTIN
+  - - 10
+    - REPLACE
+    - SQL_BUILTIN
+  - - 11
+    - SUBSTR
+    - SQL_BUILTIN
+  - - 12
+    - GROUP_CONCAT
+    - SQL_BUILTIN
+  - - 13
+    - JULIANDAY
+    - SQL_BUILTIN
+  - - 14
+    - DATE
+    - SQL_BUILTIN
+  - - 15
+    - TIME
+    - SQL_BUILTIN
+  - - 16
+    - DATETIME
+    - SQL_BUILTIN
+  - - 17
+    - STRFTIME
+    - SQL_BUILTIN
+  - - 18
+    - CURRENT_TIME
+    - SQL_BUILTIN
+  - - 19
+    - CURRENT_TIMESTAMP
+    - SQL_BUILTIN
+  - - 20
+    - CURRENT_DATE
+    - SQL_BUILTIN
+  - - 21
+    - LENGTH
+    - SQL_BUILTIN
+  - - 22
+    - POSITION
+    - SQL_BUILTIN
+  - - 23
+    - ROUND
+    - SQL_BUILTIN
+  - - 24
+    - UPPER
+    - SQL_BUILTIN
+  - - 25
+    - LOWER
+    - SQL_BUILTIN
+  - - 26
+    - IFNULL
+    - SQL_BUILTIN
+  - - 27
+    - RANDOM
+    - SQL_BUILTIN
+  - - 28
+    - CEIL
+    - SQL_BUILTIN
+  - - 29
+    - CEILING
+    - SQL_BUILTIN
+  - - 30
+    - CHARACTER_LENGTH
+    - SQL_BUILTIN
+  - - 31
+    - CHAR_LENGTH
+    - SQL_BUILTIN
+  - - 32
+    - FLOOR
+    - SQL_BUILTIN
+  - - 33
+    - MOD
+    - SQL_BUILTIN
+  - - 34
+    - OCTET_LENGTH
+    - SQL_BUILTIN
+  - - 35
+    - ROW_COUNT
+    - SQL_BUILTIN
+  - - 36
+    - COUNT
+    - SQL_BUILTIN
+  - - 37
+    - LIKE
+    - SQL_BUILTIN
+  - - 38
+    - ABS
+    - SQL_BUILTIN
+  - - 39
+    - EXP
+    - SQL_BUILTIN
+  - - 40
+    - LN
+    - SQL_BUILTIN
+  - - 41
+    - POWER
+    - SQL_BUILTIN
+  - - 42
+    - SQRT
+    - SQL_BUILTIN
+  - - 43
+    - SUM
+    - SQL_BUILTIN
+  - - 44
+    - TOTAL
+    - SQL_BUILTIN
+  - - 45
+    - AVG
+    - SQL_BUILTIN
+  - - 46
+    - RANDOMBLOB
+    - SQL_BUILTIN
+  - - 47
+    - NULLIF
+    - SQL_BUILTIN
+  - - 48
+    - ZEROBLOB
+    - SQL_BUILTIN
+  - - 49
+    - MIN
+    - SQL_BUILTIN
+  - - 50
+    - MAX
+    - SQL_BUILTIN
+  - - 51
+    - COALESCE
+    - SQL_BUILTIN
+  - - 52
+    - EVERY
+    - SQL_BUILTIN
+  - - 53
+    - EXISTS
+    - SQL_BUILTIN
+  - - 54
+    - EXTRACT
+    - SQL_BUILTIN
+  - - 55
+    - SOME
+    - SQL_BUILTIN
+  - - 56
+    - GREATER
+    - SQL_BUILTIN
+  - - 57
+    - LESSER
+    - SQL_BUILTIN
+  - - 58
+    - SOUNDEX
+    - SQL_BUILTIN
+  - - 59
+    - LIKELIHOOD
+    - SQL_BUILTIN
+  - - 60
+    - LIKELY
+    - SQL_BUILTIN
+  - - 61
+    - UNLIKELY
+    - SQL_BUILTIN
+  - - 62
+    - _sql_stat_get
+    - SQL_BUILTIN
+  - - 63
+    - _sql_stat_push
+    - SQL_BUILTIN
+  - - 64
+    - _sql_stat_init
+    - SQL_BUILTIN
+  - - 65
+    - LUA
+    - LUA
+  - - 66
+    - GREATEST
+    - SQL_BUILTIN
+  - - 67
+    - LEAST
+    - SQL_BUILTIN
 ...
 session = nil
 ---
diff --git a/test/box/access_misc.test.lua b/test/box/access_misc.test.lua
index 7783dc1..7abf4ae 100644
--- a/test/box/access_misc.test.lua
+++ b/test/box/access_misc.test.lua
@@ -294,7 +294,9 @@ sq:drop()
 
 box.space._user:select()
 box.space._space:select()
-box.space._func:select()
+funcs = {}
+for _, v in box.space._func:pairs() do table.insert(funcs, {v.id, v.name, v.language}) end
+funcs
 
 session = nil
 
-- 
2.7.4



More information about the Tarantool-patches mailing list