mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +00:00

committed by
Justin M. Keyes

parent
16a6f44570
commit
499c9a1553
@@ -9,6 +9,7 @@ local command = helpers.command
|
|||||||
local wait = helpers.wait
|
local wait = helpers.wait
|
||||||
local iswin = helpers.iswin
|
local iswin = helpers.iswin
|
||||||
local get_pathsep = helpers.get_pathsep
|
local get_pathsep = helpers.get_pathsep
|
||||||
|
local pathroot = helpers.pathroot
|
||||||
local nvim_set = helpers.nvim_set
|
local nvim_set = helpers.nvim_set
|
||||||
local expect_twostreams = helpers.expect_twostreams
|
local expect_twostreams = helpers.expect_twostreams
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
@@ -63,7 +64,7 @@ describe('jobs', function()
|
|||||||
nvim('command', "let j = jobstart('pwd', g:job_opts)")
|
nvim('command', "let j = jobstart('pwd', g:job_opts)")
|
||||||
end
|
end
|
||||||
eq({'notification', 'stdout',
|
eq({'notification', 'stdout',
|
||||||
{0, {(iswin() and [[C:\]] or '/'), ''}}}, next_msg())
|
{0, {pathroot(), ''}}}, next_msg())
|
||||||
eq({'notification', 'stdout', {0, {''}}}, next_msg())
|
eq({'notification', 'stdout', {0, {''}}}, next_msg())
|
||||||
eq({'notification', 'exit', {0, 0}}, next_msg())
|
eq({'notification', 'exit', {0, 0}}, next_msg())
|
||||||
end)
|
end)
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
|
local eq = helpers.eq
|
||||||
local ok = helpers.ok
|
local ok = helpers.ok
|
||||||
local call = helpers.call
|
local call = helpers.call
|
||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
|
local iswin = helpers.iswin
|
||||||
|
|
||||||
describe('hostname()', function()
|
describe('hostname()', function()
|
||||||
before_each(clear)
|
before_each(clear)
|
||||||
@@ -11,7 +13,8 @@ describe('hostname()', function()
|
|||||||
ok(string.len(actual) > 0)
|
ok(string.len(actual) > 0)
|
||||||
if call('executable', 'hostname') == 1 then
|
if call('executable', 'hostname') == 1 then
|
||||||
local expected = string.gsub(call('system', 'hostname'), '[\n\r]', '')
|
local expected = string.gsub(call('system', 'hostname'), '[\n\r]', '')
|
||||||
helpers.eq(expected, actual)
|
eq((iswin() and expected:upper() or expected),
|
||||||
|
(iswin() and actual:upper() or actual))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
@@ -603,6 +603,11 @@ local function get_pathsep()
|
|||||||
return funcs.fnamemodify('.', ':p'):sub(-1)
|
return funcs.fnamemodify('.', ':p'):sub(-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function pathroot()
|
||||||
|
local pathsep = package.config:sub(1,1)
|
||||||
|
return iswin() and (nvim_dir:sub(1,2)..pathsep) or '/'
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns a valid, platform-independent $NVIM_LISTEN_ADDRESS.
|
-- Returns a valid, platform-independent $NVIM_LISTEN_ADDRESS.
|
||||||
-- Useful for communicating with child instances.
|
-- Useful for communicating with child instances.
|
||||||
local function new_pipename()
|
local function new_pipename()
|
||||||
@@ -736,6 +741,7 @@ local module = {
|
|||||||
meth_pcall = meth_pcall,
|
meth_pcall = meth_pcall,
|
||||||
NIL = mpack.NIL,
|
NIL = mpack.NIL,
|
||||||
get_pathsep = get_pathsep,
|
get_pathsep = get_pathsep,
|
||||||
|
pathroot = pathroot,
|
||||||
missing_provider = missing_provider,
|
missing_provider = missing_provider,
|
||||||
alter_slashes = alter_slashes,
|
alter_slashes = alter_slashes,
|
||||||
hexdump = hexdump,
|
hexdump = hexdump,
|
||||||
|
Reference in New Issue
Block a user