diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/functional/lua/treesitter_spec.lua | 8 | ||||
| -rw-r--r-- | test/functional/ui/options_spec.lua | 7 | ||||
| -rw-r--r-- | test/helpers.lua | 15 |
3 files changed, 24 insertions, 6 deletions
diff --git a/test/functional/lua/treesitter_spec.lua b/test/functional/lua/treesitter_spec.lua index c041478af6..5bca42a4fc 100644 --- a/test/functional/lua/treesitter_spec.lua +++ b/test/functional/lua/treesitter_spec.lua @@ -250,13 +250,13 @@ void ui_refresh(void) }, res) end) - it('allow loading query with escaped quotes and capture them with `match?` and `vim-match?`', function() + it('allow loading query with escaped quotes and capture them with `lua-match?` and `vim-match?`', function() if not check_parser() then return end insert('char* astring = "Hello World!";') local res = exec_lua([[ - cquery = vim.treesitter.parse_query("c", '((_) @quote (vim-match? @quote "^\\"$")) ((_) @quote (match? @quote "^\\"$"))') + cquery = vim.treesitter.parse_query("c", '((_) @quote (vim-match? @quote "^\\"$")) ((_) @quote (lua-match? @quote "^\\"$"))') parser = vim.treesitter.get_parser(0, "c") tree = parser:parse() res = {} @@ -323,7 +323,7 @@ void ui_refresh(void) return list ]] - eq({ 'contains?', 'eq?', 'is-main?', 'match?', 'vim-match?' }, res_list) + eq({ 'contains?', 'eq?', 'is-main?', 'lua-match?', 'match?', 'vim-match?' }, res_list) end) it('supports highlighting', function() @@ -373,7 +373,7 @@ static int nlua_schedule(lua_State *const lstate) ; Use lua regexes ((identifier) @Identifier (#contains? @Identifier "lua_")) -((identifier) @Constant (#match? @Constant "^[A-Z_]+$")) +((identifier) @Constant (#lua-match? @Constant "^[A-Z_]+$")) ((identifier) @Normal (#vim-match? @Constant "^lstate$")) ((binary_expression left: (identifier) @WarningMsg.left right: (identifier) @WarningMsg.right) (#eq? @WarningMsg.left @WarningMsg.right)) diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua index 1593f04f41..2f113f6ac6 100644 --- a/test/functional/ui/options_spec.lua +++ b/test/functional/ui/options_spec.lua @@ -17,6 +17,7 @@ describe('UI receives option updates', function() guifontwide='', linespace=0, pumblend=0, + mousefocus=false, showtabline=1, termguicolors=false, ttimeout=true, @@ -109,6 +110,12 @@ describe('UI receives option updates', function() eq(expected, screen.options) end) + command("set mousefocus") + expected.mousefocus = true + screen:expect(function() + eq(expected, screen.options) + end) + command("set nottimeout") expected.ttimeout = false screen:expect(function() diff --git a/test/helpers.lua b/test/helpers.lua index 40b93d9935..7817345617 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -200,14 +200,25 @@ function module.check_logs() end end fd:close() - os.remove(file) if #lines > 0 then + local status, f local out = io.stdout + if os.getenv('SYMBOLIZER') then + status, f = pcall(module.popen_r, os.getenv('SYMBOLIZER'), '-l', file) + end out:write(start_msg .. '\n') - out:write('= ' .. table.concat(lines, '\n= ') .. '\n') + if status then + for line in f:lines() do + out:write('= '..line..'\n') + end + f:close() + else + out:write('= ' .. table.concat(lines, '\n= ') .. '\n') + end out:write(select(1, start_msg:gsub('.', '=')) .. '\n') table.insert(runtime_errors, file) end + os.remove(file) end end end |