diff options
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/api/server_requests_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/api/vim_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/core/channels_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/core/job_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/helpers.lua | 21 | ||||
-rw-r--r-- | test/functional/legacy/file_perm_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/messages_spec.lua | 34 | ||||
-rw-r--r-- | test/functional/ui/mode_spec.lua | 2 |
8 files changed, 46 insertions, 27 deletions
diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index ddd044a10f..a20667de40 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -180,7 +180,7 @@ describe('server -> client', function() end) describe('recursive (child) nvim client', function() - if helpers.isCI('travis') and helpers.os_name() == 'osx' then + if helpers.isCI('travis') and helpers.is_os('mac') then -- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. pending("[Hangs on Travis macOS. #5002]", function() end) return @@ -339,7 +339,7 @@ describe('server -> client', function() describe('connecting to its own pipe address', function() it('does not deadlock', function() - if not helpers.isCI('travis') and helpers.os_name() == 'osx' then + if not helpers.isCI('travis') and helpers.is_os('mac') then -- It does, in fact, deadlock on QuickBuild. #6851 pending("deadlocks on QuickBuild", function() end) return diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 07c0c5c8f3..b80b1c87af 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -11,7 +11,7 @@ local iswin = helpers.iswin local meth_pcall = helpers.meth_pcall local meths = helpers.meths local ok, nvim_async, feed = helpers.ok, helpers.nvim_async, helpers.feed -local os_name = helpers.os_name +local is_os = helpers.is_os local parse_context = helpers.parse_context local request = helpers.request local source = helpers.source @@ -83,7 +83,7 @@ describe('API', function() nvim('command', 'w') local f = io.open(fname) ok(f ~= nil) - if os_name() == 'windows' then + if is_os('win') then eq('testing\r\napi\r\n', f:read('*a')) else eq('testing\napi\n', f:read('*a')) diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua index 852d9808f5..1ef34c7318 100644 --- a/test/functional/core/channels_spec.lua +++ b/test/functional/core/channels_spec.lua @@ -7,7 +7,7 @@ local sleep = helpers.sleep local spawn, nvim_argv = helpers.spawn, helpers.nvim_argv local set_session = helpers.set_session local nvim_prog = helpers.nvim_prog -local os_name = helpers.os_name +local is_os = helpers.is_os local retry = helpers.retry local expect_twostreams = helpers.expect_twostreams @@ -140,7 +140,7 @@ describe('channels', function() command("call chansend(id, 'incomplet\004')") local is_bsd = not not string.find(uname(), 'bsd') - local bsdlike = is_bsd or (os_name() == "osx") + local bsdlike = is_bsd or is_os('mac') local extra = bsdlike and "^D\008\008" or "" expect_twoline(id, "stdout", "incomplet"..extra, "[1, ['incomplet'], 'stdin']", true) diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 88951e5b51..94b34ef05b 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -206,7 +206,7 @@ describe('jobs', function() it("will not buffer data if it doesn't end in newlines", function() if helpers.isCI('travis') and os.getenv('CC') == 'gcc-4.9' - and helpers.os_name() == "osx" then + and helpers.is_os('mac') then -- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. pending("[Hangs on Travis macOS. #5002]", function() end) return diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index c34849b439..cf9f5f9858 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -15,6 +15,7 @@ local check_logs = global_helpers.check_logs local dedent = global_helpers.dedent local eq = global_helpers.eq local filter = global_helpers.filter +local is_os = global_helpers.is_os local map = global_helpers.map local ok = global_helpers.ok local sleep = global_helpers.sleep @@ -271,22 +272,6 @@ function module.eval(expr) return module.request('nvim_eval', expr) end -module.os_name = (function() - local name = nil - return (function() - if not name then - if module.eval('has("win32")') == 1 then - name = 'windows' - elseif module.eval('has("macunix")') == 1 then - name = 'osx' - else - name = 'unix' - end - end - return name - end) -end)() - -- Executes a VimL function. -- Fails on VimL error, but does not update v:errmsg. function module.call(name, ...) @@ -609,7 +594,7 @@ local function do_rmdir(path) -- Try Nvim delete(): it handles `readonly` attribute on Windows, -- and avoids Lua cross-version/platform incompatibilities. if -1 == module.call('delete', abspath) then - local hint = (module.os_name() == 'windows' + local hint = (is_os('win') and ' (hint: try :%bwipeout! before rmdir())' or '') error('delete() failed'..hint..': '..abspath) end @@ -626,7 +611,7 @@ end function module.rmdir(path) local ret, _ = pcall(do_rmdir, path) - if not ret and module.os_name() == "windows" then + if not ret and is_os('win') then -- Maybe "Permission denied"; try again after changing the nvim -- process to the top-level directory. module.command([[exe 'cd '.fnameescape(']]..start_dir.."')") diff --git a/test/functional/legacy/file_perm_spec.lua b/test/functional/legacy/file_perm_spec.lua index d61fdc9b83..8fdee95e91 100644 --- a/test/functional/legacy/file_perm_spec.lua +++ b/test/functional/legacy/file_perm_spec.lua @@ -21,7 +21,7 @@ describe('Test getting and setting file permissions', function() eq(9, call('len', call('getfperm', tempfile))) eq(1, call('setfperm', tempfile, 'rwx------')) - if helpers.os_name() == 'windows' then + if helpers.is_os('win') then eq('rw-rw-rw-', call('getfperm', tempfile)) else eq('rwx------', call('getfperm', tempfile)) diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index ed65c4526f..a6b9ef9387 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -1052,3 +1052,37 @@ describe('ui/msg_puts_printf', function() os.execute('cmake -E remove_directory '..test_build_dir..'/share') end) end) + +describe('pager', function() + local screen + + before_each(function() + clear() + screen = Screen.new(25, 5) + screen:attach() + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue1}, + [4] = {bold = true, foreground = Screen.colors.SeaGreen4}, + }) + end) + + it('can be quit', function() + command("set more") + feed(':echon join(map(range(0, &lines*2), "v:val"), "\\n")<cr>') + screen:expect{grid=[[ + 0 | + 1 | + 2 | + 3 | + {4:-- More --}^ | + ]]} + feed('q') + screen:expect{grid=[[ + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + end) +end) diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua index a09df075aa..200f6eecdb 100644 --- a/test/functional/ui/mode_spec.lua +++ b/test/functional/ui/mode_spec.lua @@ -62,7 +62,7 @@ describe('ui mode_change event', function() ]], mode="normal"} command("set showmatch") - command("set matchtime=1") -- tenths of seconds + command("set matchtime=2") -- tenths of seconds feed('a(stuff') screen:expect{grid=[[ word(stuff^ | |