mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
commit
337299c808
@ -7,7 +7,7 @@ build_script:
|
|||||||
- call ci\build.bat
|
- call ci\build.bat
|
||||||
cache:
|
cache:
|
||||||
- C:\msys64\var\cache\pacman\pkg -> ci\build.bat
|
- C:\msys64\var\cache\pacman\pkg -> ci\build.bat
|
||||||
- .deps -> third-party/**
|
- .deps -> third-party\**
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: build/Neovim.zip
|
- path: build/Neovim.zip
|
||||||
- path: build/bin/nvim.exe
|
- path: build/bin/nvim.exe
|
||||||
|
@ -120,8 +120,10 @@
|
|||||||
/* mch_open_rw(): invoke os_open() with third argument for user R/W. */
|
/* mch_open_rw(): invoke os_open() with third argument for user R/W. */
|
||||||
#if defined(UNIX) /* open in rw------- mode */
|
#if defined(UNIX) /* open in rw------- mode */
|
||||||
# define mch_open_rw(n, f) os_open((n), (f), (mode_t)0600)
|
# define mch_open_rw(n, f) os_open((n), (f), (mode_t)0600)
|
||||||
|
#elif defined(WIN32)
|
||||||
|
# define mch_open_rw(n, f) os_open((n), (f), S_IREAD | S_IWRITE)
|
||||||
#else
|
#else
|
||||||
# define mch_open_rw(n, f) os_open((n), (f), 0)
|
# define mch_open_rw(n, f) os_open((n), (f), 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG))
|
# define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG))
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
-- Test for benchmarking RE engine.
|
-- Test for benchmarking RE engine.
|
||||||
|
|
||||||
local helpers = require('test.functional.helpers')
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local insert, source = helpers.insert, helpers.source
|
local insert, source = helpers.insert, helpers.source
|
||||||
local clear, execute, wait = helpers.clear, helpers.execute, helpers.wait
|
local clear, command = helpers.clear, helpers.command
|
||||||
|
|
||||||
-- Temporary file for gathering benchmarking results for each regexp engine.
|
-- Temporary file for gathering benchmarking results for each regexp engine.
|
||||||
local result_file = 'benchmark.out'
|
local result_file = 'benchmark.out'
|
||||||
@ -31,7 +31,7 @@ describe('regexp search', function()
|
|||||||
clear()
|
clear()
|
||||||
source(measure_script)
|
source(measure_script)
|
||||||
insert('" Benchmark_results:')
|
insert('" Benchmark_results:')
|
||||||
execute('write! ' .. result_file)
|
command('write! ' .. result_file)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- At the end of the test run we just print the contents of the result file
|
-- At the end of the test run we just print the contents of the result file
|
||||||
@ -46,22 +46,19 @@ describe('regexp search', function()
|
|||||||
|
|
||||||
it('is working with regexpengine=0', function()
|
it('is working with regexpengine=0', function()
|
||||||
local regexpengine = 0
|
local regexpengine = 0
|
||||||
execute(string.format(measure_cmd, regexpengine))
|
command(string.format(measure_cmd, regexpengine))
|
||||||
execute('write')
|
command('write')
|
||||||
wait()
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('is working with regexpengine=1', function()
|
it('is working with regexpengine=1', function()
|
||||||
local regexpengine = 1
|
local regexpengine = 1
|
||||||
execute(string.format(measure_cmd, regexpengine))
|
command(string.format(measure_cmd, regexpengine))
|
||||||
execute('write')
|
command('write')
|
||||||
wait()
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('is working with regexpengine=2', function()
|
it('is working with regexpengine=2', function()
|
||||||
local regexpengine = 2
|
local regexpengine = 2
|
||||||
execute(string.format(measure_cmd, regexpengine))
|
command(string.format(measure_cmd, regexpengine))
|
||||||
execute('write')
|
command('write')
|
||||||
wait()
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
35
test/functional/ex_cmds/file_spec.lua
Normal file
35
test/functional/ex_cmds/file_spec.lua
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
|
local lfs = require('lfs')
|
||||||
|
local clear = helpers.clear
|
||||||
|
local command = helpers.command
|
||||||
|
local eq = helpers.eq
|
||||||
|
local funcs = helpers.funcs
|
||||||
|
local rmdir = helpers.rmdir
|
||||||
|
|
||||||
|
describe(':file', function()
|
||||||
|
local swapdir = lfs.currentdir()..'/Xtest-file_spec'
|
||||||
|
before_each(function()
|
||||||
|
clear()
|
||||||
|
rmdir(swapdir)
|
||||||
|
lfs.mkdir(swapdir)
|
||||||
|
end)
|
||||||
|
after_each(function()
|
||||||
|
command('%bwipeout!')
|
||||||
|
rmdir(swapdir)
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("rename does not lose swapfile #6487", function()
|
||||||
|
local testfile = 'test-file_spec'
|
||||||
|
local testfile_renamed = testfile..'-renamed'
|
||||||
|
-- Note: `set swapfile` *must* go after `set directory`: otherwise it may
|
||||||
|
-- attempt to create a swapfile in different directory.
|
||||||
|
command('set directory^='..swapdir..'//')
|
||||||
|
command('set swapfile fileformat=unix undolevels=-1')
|
||||||
|
|
||||||
|
command('edit! '..testfile)
|
||||||
|
-- Before #6487 this gave "E301: Oops, lost the swap file !!!" on Windows.
|
||||||
|
command('file '..testfile_renamed)
|
||||||
|
eq(testfile_renamed..'.swp',
|
||||||
|
string.match(funcs.execute('swapname'), '[^%%]+$'))
|
||||||
|
end)
|
||||||
|
end)
|
@ -1,12 +1,11 @@
|
|||||||
-- Tests for :recover
|
|
||||||
|
|
||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local lfs = require('lfs')
|
local lfs = require('lfs')
|
||||||
local feed_command, eq, clear, eval, feed, expect, source =
|
local feed_command, eq, clear, eval, feed, expect, source =
|
||||||
helpers.feed_command, helpers.eq, helpers.clear, helpers.eval, helpers.feed,
|
helpers.feed_command, helpers.eq, helpers.clear, helpers.eval, helpers.feed,
|
||||||
helpers.expect, helpers.source
|
helpers.expect, helpers.source
|
||||||
|
local command = helpers.command
|
||||||
if helpers.pending_win32(pending) then return end
|
local ok = helpers.ok
|
||||||
|
local rmdir = helpers.rmdir
|
||||||
|
|
||||||
describe(':recover', function()
|
describe(':recover', function()
|
||||||
before_each(clear)
|
before_each(clear)
|
||||||
@ -23,30 +22,29 @@ describe(':preserve', function()
|
|||||||
local swapdir = lfs.currentdir()..'/testdir_recover_spec'
|
local swapdir = lfs.currentdir()..'/testdir_recover_spec'
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
helpers.rmdir(swapdir)
|
rmdir(swapdir)
|
||||||
lfs.mkdir(swapdir)
|
lfs.mkdir(swapdir)
|
||||||
end)
|
end)
|
||||||
after_each(function()
|
after_each(function()
|
||||||
helpers.rmdir(swapdir)
|
command('%bwipeout!')
|
||||||
|
rmdir(swapdir)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("saves to custom 'directory' and (R)ecovers (issue #1836)", function()
|
it("saves to custom 'directory' and (R)ecovers (issue #1836)", function()
|
||||||
local testfile = 'testfile_recover_spec'
|
local testfile = 'testfile_recover_spec'
|
||||||
|
-- Put swapdir at the start of the 'directory' list. #1836
|
||||||
-- Note: `set swapfile` *must* go after `set directory`: otherwise it may
|
-- Note: `set swapfile` *must* go after `set directory`: otherwise it may
|
||||||
-- attempt to create a swapfile in different directory.
|
-- attempt to create a swapfile in different directory.
|
||||||
local init = [[
|
local init = [[
|
||||||
set directory^=]]..swapdir..[[//
|
set directory^=]]..swapdir:gsub([[\]], [[\\]])..[[//
|
||||||
set swapfile fileformat=unix undolevels=-1
|
set swapfile fileformat=unix undolevels=-1
|
||||||
]]
|
]]
|
||||||
|
|
||||||
source(init)
|
source(init)
|
||||||
feed_command('set swapfile fileformat=unix undolevels=-1')
|
command('edit! '..testfile)
|
||||||
-- Put swapdir at the start of the 'directory' list. #1836
|
|
||||||
feed_command('set directory^='..swapdir..'//')
|
|
||||||
feed_command('edit '..testfile)
|
|
||||||
feed('isometext<esc>')
|
feed('isometext<esc>')
|
||||||
feed_command('preserve')
|
command('preserve')
|
||||||
source('redir => g:swapname | swapname | redir END')
|
source('redir => g:swapname | silent swapname | redir END')
|
||||||
|
|
||||||
local swappath1 = eval('g:swapname')
|
local swappath1 = eval('g:swapname')
|
||||||
|
|
||||||
@ -59,19 +57,20 @@ describe(':preserve', function()
|
|||||||
source(init)
|
source(init)
|
||||||
|
|
||||||
-- Use the "SwapExists" event to choose the (R)ecover choice at the dialog.
|
-- Use the "SwapExists" event to choose the (R)ecover choice at the dialog.
|
||||||
feed_command('autocmd SwapExists * let v:swapchoice = "r"')
|
command('autocmd SwapExists * let v:swapchoice = "r"')
|
||||||
feed_command('silent edit '..testfile)
|
command('silent edit! '..testfile)
|
||||||
source('redir => g:swapname | swapname | redir END')
|
source('redir => g:swapname | silent swapname | redir END')
|
||||||
|
|
||||||
local swappath2 = eval('g:swapname')
|
local swappath2 = eval('g:swapname')
|
||||||
|
|
||||||
-- swapfile from session 1 should end in .swp
|
|
||||||
assert(testfile..'.swp' == string.match(swappath1, '[^%%]+$'))
|
|
||||||
|
|
||||||
-- swapfile from session 2 should end in .swo
|
|
||||||
assert(testfile..'.swo' == string.match(swappath2, '[^%%]+$'))
|
|
||||||
|
|
||||||
expect('sometext')
|
expect('sometext')
|
||||||
|
-- swapfile from session 1 should end in .swp
|
||||||
|
eq(testfile..'.swp', string.match(swappath1, '[^%%]+$'))
|
||||||
|
-- swapfile from session 2 should end in .swo
|
||||||
|
eq(testfile..'.swo', string.match(swappath2, '[^%%]+$'))
|
||||||
|
-- Verify that :swapname was not truncated (:help 'shortmess').
|
||||||
|
ok(nil == string.find(swappath1, '%.%.%.'))
|
||||||
|
ok(nil == string.find(swappath2, '%.%.%.'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
@ -32,20 +32,15 @@ local nvim_set = 'set shortmess+=I background=light noswapfile noautoindent'
|
|||||||
..' belloff= noshowcmd noruler nomore'
|
..' belloff= noshowcmd noruler nomore'
|
||||||
local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
|
local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
|
||||||
'--cmd', nvim_set, '--embed'}
|
'--cmd', nvim_set, '--embed'}
|
||||||
|
-- Directory containing nvim.
|
||||||
local mpack = require('mpack')
|
|
||||||
|
|
||||||
local tmpname = global_helpers.tmpname
|
|
||||||
local uname = global_helpers.uname
|
|
||||||
|
|
||||||
-- Formulate a path to the directory containing nvim. We use this to
|
|
||||||
-- help run test executables. It helps to keep the tests working, even
|
|
||||||
-- when the build is not in the default location.
|
|
||||||
local nvim_dir = nvim_prog:gsub("[/\\][^/\\]+$", "")
|
local nvim_dir = nvim_prog:gsub("[/\\][^/\\]+$", "")
|
||||||
if nvim_dir == nvim_prog then
|
if nvim_dir == nvim_prog then
|
||||||
nvim_dir = "."
|
nvim_dir = "."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local mpack = require('mpack')
|
||||||
|
local tmpname = global_helpers.tmpname
|
||||||
|
local uname = global_helpers.uname
|
||||||
local prepend_argv
|
local prepend_argv
|
||||||
|
|
||||||
if os.getenv('VALGRIND') then
|
if os.getenv('VALGRIND') then
|
||||||
@ -430,21 +425,27 @@ end
|
|||||||
|
|
||||||
local function do_rmdir(path)
|
local function do_rmdir(path)
|
||||||
if lfs.attributes(path, 'mode') ~= 'directory' then
|
if lfs.attributes(path, 'mode') ~= 'directory' then
|
||||||
return nil
|
return -- Don't complain.
|
||||||
end
|
end
|
||||||
for file in lfs.dir(path) do
|
for file in lfs.dir(path) do
|
||||||
if file ~= '.' and file ~= '..' then
|
if file ~= '.' and file ~= '..' then
|
||||||
local abspath = path..'/'..file
|
local abspath = path..'/'..file
|
||||||
if lfs.attributes(abspath, 'mode') == 'directory' then
|
if lfs.attributes(abspath, 'mode') == 'directory' then
|
||||||
local ret = do_rmdir(abspath) -- recurse
|
do_rmdir(abspath) -- recurse
|
||||||
if not ret then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
local ret, err = os.remove(abspath)
|
local ret, err = os.remove(abspath)
|
||||||
if not ret then
|
if not ret then
|
||||||
error('os.remove: '..err)
|
if not session then
|
||||||
return nil
|
error('os.remove: '..err)
|
||||||
|
else
|
||||||
|
-- Try Nvim delete(): it handles `readonly` attribute on Windows,
|
||||||
|
-- and avoids Lua cross-version/platform incompatibilities.
|
||||||
|
if -1 == nvim_call('delete', abspath) then
|
||||||
|
local hint = (os_name() == 'windows'
|
||||||
|
and ' (hint: try :%bwipeout! before rmdir())' or '')
|
||||||
|
error('delete() failed'..hint..': '..abspath)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -453,7 +454,6 @@ local function do_rmdir(path)
|
|||||||
if not ret then
|
if not ret then
|
||||||
error('lfs.rmdir('..path..'): '..err)
|
error('lfs.rmdir('..path..'): '..err)
|
||||||
end
|
end
|
||||||
return ret
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function rmdir(path)
|
local function rmdir(path)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local clear, insert, eq = helpers.clear, helpers.insert, helpers.eq
|
local clear, insert, eq = helpers.clear, helpers.insert, helpers.eq
|
||||||
local execute, expect = helpers.execute, helpers.expect
|
local command, expect = helpers.command, helpers.expect
|
||||||
local feed, eval = helpers.feed, helpers.eval
|
local feed, eval = helpers.feed, helpers.eval
|
||||||
local exc_exec = helpers.exc_exec
|
local exc_exec = helpers.exc_exec
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ describe('gu and gU', function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
execute('lang ctype tr_TR.UTF-8')
|
command('lang ctype tr_TR.UTF-8')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('with default casemap', function()
|
it('with default casemap', function()
|
||||||
@ -46,7 +46,7 @@ describe('gu and gU', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('with casemap=""', function()
|
it('with casemap=""', function()
|
||||||
execute('set casemap=')
|
command('set casemap=')
|
||||||
-- expect Turkish locale behavior
|
-- expect Turkish locale behavior
|
||||||
insert("iI")
|
insert("iI")
|
||||||
feed("VgU")
|
feed("VgU")
|
||||||
|
@ -5,6 +5,7 @@ local eq = helpers.eq
|
|||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
local meths = helpers.meths
|
local meths = helpers.meths
|
||||||
local exc_exec = helpers.exc_exec
|
local exc_exec = helpers.exc_exec
|
||||||
|
local rmdir = helpers.rmdir
|
||||||
local write_file = helpers.write_file
|
local write_file = helpers.write_file
|
||||||
|
|
||||||
local testdir = 'Xtest-functional-spell-spellfile.d'
|
local testdir = 'Xtest-functional-spell-spellfile.d'
|
||||||
@ -12,11 +13,12 @@ local testdir = 'Xtest-functional-spell-spellfile.d'
|
|||||||
describe('spellfile', function()
|
describe('spellfile', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
|
rmdir(testdir)
|
||||||
lfs.mkdir(testdir)
|
lfs.mkdir(testdir)
|
||||||
lfs.mkdir(testdir .. '/spell')
|
lfs.mkdir(testdir .. '/spell')
|
||||||
end)
|
end)
|
||||||
after_each(function()
|
after_each(function()
|
||||||
lfs.rmdir(testdir)
|
rmdir(testdir)
|
||||||
end)
|
end)
|
||||||
-- ┌ Magic string (#VIMSPELLMAGIC)
|
-- ┌ Magic string (#VIMSPELLMAGIC)
|
||||||
-- │ ┌ Spell file version (#VIMSPELLVERSION)
|
-- │ ┌ Spell file version (#VIMSPELLVERSION)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
|
local command = helpers.command
|
||||||
local curbufmeths = helpers.curbufmeths
|
local curbufmeths = helpers.curbufmeths
|
||||||
local eq = helpers.eq
|
local eq = helpers.eq
|
||||||
local eval = helpers.eval
|
local eval = helpers.eval
|
||||||
@ -21,9 +22,9 @@ local default_text = [[
|
|||||||
|
|
||||||
local function common_setup(screen, inccommand, text)
|
local function common_setup(screen, inccommand, text)
|
||||||
if screen then
|
if screen then
|
||||||
feed_command("syntax on")
|
command("syntax on")
|
||||||
feed_command("set nohlsearch")
|
command("set nohlsearch")
|
||||||
feed_command("hi Substitute guifg=red guibg=yellow")
|
command("hi Substitute guifg=red guibg=yellow")
|
||||||
screen:attach()
|
screen:attach()
|
||||||
screen:set_default_attr_ids({
|
screen:set_default_attr_ids({
|
||||||
[1] = {foreground = Screen.colors.Fuchsia},
|
[1] = {foreground = Screen.colors.Fuchsia},
|
||||||
@ -46,7 +47,7 @@ local function common_setup(screen, inccommand, text)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
feed_command("set inccommand=" .. (inccommand and inccommand or ""))
|
command("set inccommand=" .. (inccommand and inccommand or ""))
|
||||||
|
|
||||||
if text then
|
if text then
|
||||||
insert(text)
|
insert(text)
|
||||||
@ -456,7 +457,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
|
|||||||
insert("X")
|
insert("X")
|
||||||
feed("IY<esc>")
|
feed("IY<esc>")
|
||||||
feed(":%s/tw/MO/<esc>")
|
feed(":%s/tw/MO/<esc>")
|
||||||
-- execute("undo") here would cause "Press ENTER".
|
-- feed_command("undo") here would cause "Press ENTER".
|
||||||
feed("u")
|
feed("u")
|
||||||
expect(default_text:gsub("Inc", "XInc"))
|
expect(default_text:gsub("Inc", "XInc"))
|
||||||
feed("u")
|
feed("u")
|
||||||
@ -514,7 +515,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
|
|||||||
feed("Ay<esc>")
|
feed("Ay<esc>")
|
||||||
feed("Az<esc>")
|
feed("Az<esc>")
|
||||||
feed(":%s/tw/AR<esc>")
|
feed(":%s/tw/AR<esc>")
|
||||||
-- using execute("undo") here will result in a "Press ENTER" prompt
|
-- feed_command("undo") here would cause "Press ENTER".
|
||||||
feed("u")
|
feed("u")
|
||||||
expect(default_text:gsub("lines", "linesxy"))
|
expect(default_text:gsub("lines", "linesxy"))
|
||||||
feed("u")
|
feed("u")
|
||||||
@ -603,7 +604,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
|
|||||||
|
|
||||||
feed_command("set undolevels=-1")
|
feed_command("set undolevels=-1")
|
||||||
feed(":%s/tw/MO/g<enter>")
|
feed(":%s/tw/MO/g<enter>")
|
||||||
-- using execute("undo") here will result in a "Press ENTER" prompt
|
-- feed_command("undo") here will result in a "Press ENTER" prompt
|
||||||
feed("u")
|
feed("u")
|
||||||
if case == "split" then
|
if case == "split" then
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
@ -804,7 +805,6 @@ describe(":substitute, inccommand=split", function()
|
|||||||
it('does not show split window for :s/', function()
|
it('does not show split window for :s/', function()
|
||||||
feed("2gg")
|
feed("2gg")
|
||||||
feed(":s/tw")
|
feed(":s/tw")
|
||||||
wait()
|
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
Inc substitution on |
|
Inc substitution on |
|
||||||
two lines |
|
two lines |
|
||||||
@ -1291,14 +1291,14 @@ describe("'inccommand' and :cnoremap", function()
|
|||||||
it('work with remapped characters', function()
|
it('work with remapped characters', function()
|
||||||
for _, case in pairs(cases) do
|
for _, case in pairs(cases) do
|
||||||
refresh(case)
|
refresh(case)
|
||||||
local command = "%s/lines/LINES/g"
|
local cmd = "%s/lines/LINES/g"
|
||||||
|
|
||||||
for i = 1, string.len(command) do
|
for i = 1, string.len(cmd) do
|
||||||
local c = string.sub(command, i, i)
|
local c = string.sub(cmd, i, i)
|
||||||
feed_command("cnoremap ".. c .. " " .. c)
|
feed_command("cnoremap ".. c .. " " .. c)
|
||||||
end
|
end
|
||||||
|
|
||||||
feed_command(command)
|
feed_command(cmd)
|
||||||
expect([[
|
expect([[
|
||||||
Inc substitution on
|
Inc substitution on
|
||||||
two LINES
|
two LINES
|
||||||
|
@ -284,18 +284,13 @@ function Screen:wait(check, timeout)
|
|||||||
|
|
||||||
if failure_after_success then
|
if failure_after_success then
|
||||||
print([[
|
print([[
|
||||||
Warning: Screen changes have been received after the expected state was seen.
|
|
||||||
This is probably due to an indeterminism in the test. Try adding
|
|
||||||
`wait()` (or even a separate `screen:expect(...)`) at a point of possible
|
|
||||||
indeterminism, typically in between a `feed()` or `execute()` which is non-
|
|
||||||
synchronous, and a synchronous api call.
|
|
||||||
|
|
||||||
Note that sometimes a `wait` can trigger redraws and consequently generate more
|
Warning: Screen changes were received after the expected state. This indicates
|
||||||
indeterminism. If adding `wait` calls seems to increase the frequency of these
|
indeterminism in the test. Try adding wait() (or screen:expect(...)) between
|
||||||
messages, try removing every `wait` call in the test.
|
asynchronous (feed(), nvim_input()) and synchronous API calls.
|
||||||
|
- Use Screen:redraw_debug() to investigate the problem.
|
||||||
If everything else fails, use Screen:redraw_debug to help investigate what is
|
- wait() can trigger redraws and consequently generate more indeterminism.
|
||||||
causing the problem.
|
In that case try removing every wait().
|
||||||
]])
|
]])
|
||||||
local tb = debug.traceback()
|
local tb = debug.traceback()
|
||||||
local index = string.find(tb, '\n%s*%[C]')
|
local index = string.find(tb, '\n%s*%[C]')
|
||||||
|
Loading…
Reference in New Issue
Block a user