diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-01 21:21:26 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-01 22:49:33 -0700 |
commit | ead39d6ce6d1c5e5b6130c6823d071889c207bde (patch) | |
tree | 0a1b0b8707e6a951e3318bfbba80a1764749a2dd /test/functional | |
parent | 7d2090772488e9d57532c2f3d72438370027d3b9 (diff) | |
download | rneovim-ead39d6ce6d1c5e5b6130c6823d071889c207bde.tar.gz rneovim-ead39d6ce6d1c5e5b6130c6823d071889c207bde.tar.bz2 rneovim-ead39d6ce6d1c5e5b6130c6823d071889c207bde.zip |
test/uname(): always lowercase
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/core/channels_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/helpers.lua | 14 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 8 | ||||
-rw-r--r-- | test/functional/ui/cmdline_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/embed_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/output_spec.lua | 2 |
6 files changed, 13 insertions, 17 deletions
diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua index 30dcb6d7b4..852d9808f5 100644 --- a/test/functional/core/channels_spec.lua +++ b/test/functional/core/channels_spec.lua @@ -139,7 +139,7 @@ describe('channels', function() command("call chansend(id, 'incomplet\004')") - local is_bsd = not not string.find(string.lower(uname()), 'bsd') + local is_bsd = not not string.find(uname(), 'bsd') local bsdlike = is_bsd or (os_name() == "osx") local extra = bsdlike and "^D\008\008" or "" expect_twoline(id, "stdout", diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index c718a37021..c34849b439 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -48,7 +48,7 @@ if module.nvim_dir == module.nvim_prog then end local tmpname = global_helpers.tmpname -local uname = global_helpers.uname +local iswin = global_helpers.iswin local prepend_argv if os.getenv('VALGRIND') then @@ -287,10 +287,6 @@ module.os_name = (function() end) end)() -function module.iswin() - return package.config:sub(1,1) == '\\' -end - -- Executes a VimL function. -- Fails on VimL error, but does not update v:errmsg. function module.call(name, ...) @@ -672,7 +668,7 @@ end -- Helper to skip tests. Returns true in Windows systems. -- pending_fn is pending() from busted function module.pending_win32(pending_fn) - if uname() == 'Windows' then + if iswin() then if pending_fn ~= nil then pending_fn('FIXME: Windows', function() end) end @@ -734,12 +730,12 @@ function module.redir_exec(cmd) end function module.get_pathsep() - return module.iswin() and '\\' or '/' + return iswin() and '\\' or '/' end function module.pathroot() local pathsep = package.config:sub(1,1) - return module.iswin() and (module.nvim_dir:sub(1,2)..pathsep) or '/' + return iswin() and (module.nvim_dir:sub(1,2)..pathsep) or '/' end -- Returns a valid, platform-independent $NVIM_LISTEN_ADDRESS. @@ -765,7 +761,7 @@ function module.missing_provider(provider) end function module.alter_slashes(obj) - if not module.iswin() then + if not iswin() then return obj end if type(obj) == 'string' then diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 01e13ce4d4..99b25cbf48 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -902,7 +902,7 @@ end) -- does not initialize the TUI. describe("TUI 't_Co' (terminal colors)", function() local screen - local is_freebsd = (string.lower(uname()) == 'freebsd') + local is_freebsd = (uname() == 'freebsd') local function assert_term_colors(term, colorterm, maxcolors) helpers.clear({env={TERM=term}, args={}}) @@ -1176,8 +1176,8 @@ end) -- does not initialize the TUI. describe("TUI 'term' option", function() local screen - local is_bsd = not not string.find(string.lower(uname()), 'bsd') - local is_macos = not not string.find(string.lower(uname()), 'darwin') + local is_bsd = not not string.find(uname(), 'bsd') + local is_macos = not not string.find(uname(), 'darwin') local function assert_term(term_envvar, term_expected) clear() @@ -1203,7 +1203,7 @@ describe("TUI 'term' option", function() end) it('gets system-provided term if $TERM is valid', function() - if string.lower(uname()) == "openbsd" then + if uname() == "openbsd" then assert_term("xterm", "xterm") elseif is_bsd then -- BSD lacks terminfo, builtin is always used. assert_term("xterm", "builtin_xterm") diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index ea68d9a431..f9769c706f 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -828,7 +828,7 @@ describe('cmdline redraw', function() end) it('with <Cmd>', function() - if 'openbsd' == string.lower(helpers.uname()) then + if 'openbsd' == helpers.uname() then pending('FIXME #10804', function() end) return end diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua index 6b2ad7c72b..5e09dc4289 100644 --- a/test/functional/ui/embed_spec.lua +++ b/test/functional/ui/embed_spec.lua @@ -49,7 +49,7 @@ local function test_embed(ext_linegrid) end) it("doesn't erase output when setting color scheme", function() - if 'openbsd' == string.lower(helpers.uname()) then + if 'openbsd' == helpers.uname() then pending('FIXME #10804', function() end) return end diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua index 4088cb77fa..c028f44b44 100644 --- a/test/functional/ui/output_spec.lua +++ b/test/functional/ui/output_spec.lua @@ -50,7 +50,7 @@ describe("shell command :!", function() end) it("throttles shell-command output greater than ~10KB", function() - if 'openbsd' == string.lower(helpers.uname()) then + if 'openbsd' == helpers.uname() then pending('FIXME #10804', function() end) return end |