aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
commit9be89f131f87608f224f0ee06d199fcd09d32176 (patch)
tree11022dcfa9e08cb4ac5581b16734196128688d48 /test/functional/vimscript
parentff7ed8f586589d620a806c3758fac4a47a8e7e15 (diff)
parent88085c2e80a7e3ac29aabb6b5420377eed99b8b6 (diff)
downloadrneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.gz
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.bz2
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/vimscript')
-rw-r--r--test/functional/vimscript/api_functions_spec.lua2
-rw-r--r--test/functional/vimscript/changedtick_spec.lua4
-rw-r--r--test/functional/vimscript/ctx_functions_spec.lua6
-rw-r--r--test/functional/vimscript/fnamemodify_spec.lua3
-rw-r--r--test/functional/vimscript/input_spec.lua8
-rw-r--r--test/functional/vimscript/json_functions_spec.lua34
-rw-r--r--test/functional/vimscript/map_functions_spec.lua4
-rw-r--r--test/functional/vimscript/msgpack_functions_spec.lua41
-rw-r--r--test/functional/vimscript/printf_spec.lua3
-rw-r--r--test/functional/vimscript/server_spec.lua199
-rw-r--r--test/functional/vimscript/string_spec.lua8
11 files changed, 47 insertions, 265 deletions
diff --git a/test/functional/vimscript/api_functions_spec.lua b/test/functional/vimscript/api_functions_spec.lua
index b2865d2b4c..30d6c969ca 100644
--- a/test/functional/vimscript/api_functions_spec.lua
+++ b/test/functional/vimscript/api_functions_spec.lua
@@ -115,7 +115,7 @@ describe('eval-API', function()
exec_lua,
[[
local cmdwin_buf = vim.api.nvim_get_current_buf()
- vim.api.nvim_buf_call(vim.api.nvim_create_buf(false, true), function()
+ vim._with({buf = vim.api.nvim_create_buf(false, true)}, function()
vim.api.nvim_open_term(cmdwin_buf, {})
end)
]]
diff --git a/test/functional/vimscript/changedtick_spec.lua b/test/functional/vimscript/changedtick_spec.lua
index baea53a700..ef9d6b1a69 100644
--- a/test/functional/vimscript/changedtick_spec.lua
+++ b/test/functional/vimscript/changedtick_spec.lua
@@ -38,7 +38,7 @@ describe('b:changedtick', function()
-- Somehow undo counts as two changes
eq(5, changedtick())
end)
- it('is present in b: dictionary', function()
+ it('is present in b: dict', function()
eq(2, changedtick())
command('let d = b:')
eq(2, api.nvim_get_var('d').changedtick)
@@ -168,7 +168,7 @@ describe('b:changedtick', function()
)
eq(2, changedtick())
end)
- it('does not inherit VAR_FIXED when copying dictionary over', function()
+ it('does not inherit VAR_FIXED when copying dict over', function()
eq(2, changedtick())
eq('', exec_capture('let d1 = copy(b:)|let d1.changedtick = 42'))
eq('', exec_capture('let d2 = copy(b:)|unlet d2.changedtick'))
diff --git a/test/functional/vimscript/ctx_functions_spec.lua b/test/functional/vimscript/ctx_functions_spec.lua
index 5e9a803b5d..873e4f820d 100644
--- a/test/functional/vimscript/ctx_functions_spec.lua
+++ b/test/functional/vimscript/ctx_functions_spec.lua
@@ -295,7 +295,7 @@ describe('context functions', function()
eq(outofbounds, pcall_err(call, 'ctxget', 0))
end)
- it('returns context dictionary at index in context stack', function()
+ it('returns context dict at index in context stack', function()
feed('i1<cr>2<cr>3<c-[>ddddddqahjklq')
command('edit! ' .. fname1)
feed('G')
@@ -404,7 +404,7 @@ describe('context functions', function()
eq(outofbounds, pcall_err(call, 'ctxset', { dummy = 1 }, 0))
end)
- it('errors when context dictionary is invalid', function()
+ it('errors when context dict is invalid', function()
call('ctxpush')
eq(
'Vim:E474: Failed to convert list to msgpack string buffer',
@@ -412,7 +412,7 @@ describe('context functions', function()
)
end)
- it('sets context dictionary at index in context stack', function()
+ it('sets context dict at index in context stack', function()
api.nvim_set_var('one', 1)
api.nvim_set_var('Two', 2)
api.nvim_set_var('THREE', 3)
diff --git a/test/functional/vimscript/fnamemodify_spec.lua b/test/functional/vimscript/fnamemodify_spec.lua
index 51b1e8489a..f2cee9b83e 100644
--- a/test/functional/vimscript/fnamemodify_spec.lua
+++ b/test/functional/vimscript/fnamemodify_spec.lua
@@ -7,11 +7,10 @@ local fnamemodify = n.fn.fnamemodify
local getcwd = n.fn.getcwd
local command = n.command
local write_file = t.write_file
-local alter_slashes = n.alter_slashes
local is_os = t.is_os
local function eq_slashconvert(expected, got)
- eq(alter_slashes(expected), alter_slashes(got))
+ eq(t.fix_slashes(expected), t.fix_slashes(got))
end
describe('fnamemodify()', function()
diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua
index 552ae6d5cc..0b774404eb 100644
--- a/test/functional/vimscript/input_spec.lua
+++ b/test/functional/vimscript/input_spec.lua
@@ -108,7 +108,7 @@ describe('input()', function()
{T:1}^ |
]])
end)
- it('allows unequal numeric values when using {opts} dictionary', function()
+ it('allows unequal numeric values when using {opts} dict', function()
command('echohl Test')
api.nvim_set_var('opts', { prompt = 1, default = 2, cancelreturn = 3 })
feed([[:echo input(opts)<CR>]])
@@ -164,7 +164,7 @@ describe('input()', function()
reset = true,
}
end)
- it('allows omitting everything with dictionary argument', function()
+ it('allows omitting everything with dict argument', function()
command('echohl Test')
feed([[:call input({})<CR>]])
screen:expect([[
@@ -290,7 +290,7 @@ describe('inputdialog()', function()
{T:1}^ |
]])
end)
- it('allows unequal numeric values when using {opts} dictionary', function()
+ it('allows unequal numeric values when using {opts} dict', function()
command('echohl Test')
api.nvim_set_var('opts', { prompt = 1, default = 2, cancelreturn = 3 })
feed([[:echo input(opts)<CR>]])
@@ -346,7 +346,7 @@ describe('inputdialog()', function()
reset = true,
}
end)
- it('allows omitting everything with dictionary argument', function()
+ it('allows omitting everything with dict argument', function()
command('echohl Test')
feed(':echo inputdialog({})<CR>')
screen:expect([[
diff --git a/test/functional/vimscript/json_functions_spec.lua b/test/functional/vimscript/json_functions_spec.lua
index ae56e8873d..895e722e96 100644
--- a/test/functional/vimscript/json_functions_spec.lua
+++ b/test/functional/vimscript/json_functions_spec.lua
@@ -502,9 +502,9 @@ describe('json_decode() function', function()
end
it('parses strings with NUL properly', function()
- sp_decode_eq({ _TYPE = 'string', _VAL = { '\n' } }, '"\\u0000"')
- sp_decode_eq({ _TYPE = 'string', _VAL = { '\n', '\n' } }, '"\\u0000\\n\\u0000"')
- sp_decode_eq({ _TYPE = 'string', _VAL = { '\n«\n' } }, '"\\u0000\\u00AB\\u0000"')
+ sp_decode_eq('\000', '"\\u0000"')
+ sp_decode_eq('\000\n\000', '"\\u0000\\n\\u0000"')
+ sp_decode_eq('\000«\000', '"\\u0000\\u00AB\\u0000"')
end)
it('parses dictionaries with duplicate keys to special maps', function()
@@ -580,14 +580,8 @@ describe('json_decode() function', function()
end)
it('parses dictionaries with keys with NUL bytes to special maps', function()
- sp_decode_eq(
- { _TYPE = 'map', _VAL = { { { _TYPE = 'string', _VAL = { 'a\n', 'b' } }, 4 } } },
- '{"a\\u0000\\nb": 4}'
- )
- sp_decode_eq(
- { _TYPE = 'map', _VAL = { { { _TYPE = 'string', _VAL = { 'a\n', 'b', '' } }, 4 } } },
- '{"a\\u0000\\nb\\n": 4}'
- )
+ sp_decode_eq({ _TYPE = 'map', _VAL = { { 'a\000\nb', 4 } } }, '{"a\\u0000\\nb": 4}')
+ sp_decode_eq({ _TYPE = 'map', _VAL = { { 'a\000\nb\n', 4 } } }, '{"a\\u0000\\nb\\n": 4}')
sp_decode_eq({
_TYPE = 'map',
_VAL = {
@@ -595,10 +589,7 @@ describe('json_decode() function', function()
{ 'a', 1 },
{ 'c', 4 },
{ 'd', 2 },
- {
- { _TYPE = 'string', _VAL = { '\n' } },
- 4,
- },
+ { '\000', 4 },
},
}, '{"b": 3, "a": 1, "c": 4, "d": 2, "\\u0000": 4}')
end)
@@ -738,22 +729,11 @@ describe('json_encode() function', function()
eq('{"\\u0000": 1}', eval('json_encode(todump)'))
end)
- it('can dump generic mapping with BIN special key and NUL', function()
- command('let todump = {"_TYPE": v:msgpack_types.binary, "_VAL": ["\\n"]}')
- command('let todump = {"_TYPE": v:msgpack_types.map, "_VAL": [[todump, 1]]}')
- eq('{"\\u0000": 1}', eval('json_encode(todump)'))
- end)
-
it('can dump STR special mapping with NUL and NL', function()
command('let todump = {"_TYPE": v:msgpack_types.string, "_VAL": ["\\n", ""]}')
eq('"\\u0000\\n"', eval('json_encode(todump)'))
end)
- it('can dump BIN special mapping with NUL and NL', function()
- command('let todump = {"_TYPE": v:msgpack_types.binary, "_VAL": ["\\n", ""]}')
- eq('"\\u0000\\n"', eval('json_encode(todump)'))
- end)
-
it('cannot dump special ext mapping', function()
command('let todump = {"_TYPE": v:msgpack_types.ext, "_VAL": [5, ["",""]]}')
eq('Vim(call):E474: Unable to convert EXT string to JSON', exc_exec('call json_encode(todump)'))
@@ -931,7 +911,7 @@ describe('json_encode() function', function()
eq('[]', eval('json_encode(v:_null_list)'))
end)
- it('can dump NULL dictionary', function()
+ it('can dump NULL dict', function()
eq('{}', eval('json_encode(v:_null_dict)'))
end)
diff --git a/test/functional/vimscript/map_functions_spec.lua b/test/functional/vimscript/map_functions_spec.lua
index 44be5b3185..b69b7dbd57 100644
--- a/test/functional/vimscript/map_functions_spec.lua
+++ b/test/functional/vimscript/map_functions_spec.lua
@@ -36,7 +36,7 @@ describe('maparg()', function()
lnum = 0,
}
- it('returns a dictionary', function()
+ it('returns a dict', function()
command('nnoremap foo bar')
eq('bar', fn.maparg('foo'))
eq(foo_bar_map_table, fn.maparg('foo', 'n', false, true))
@@ -54,7 +54,7 @@ describe('maparg()', function()
eq('', fn.maparg('not a mapping'))
end)
- it('returns an empty dictionary when no map is present and dict is requested', function()
+ it('returns an empty dict when no map is present and dict is requested', function()
eq({}, fn.maparg('not a mapping', 'n', false, true))
end)
diff --git a/test/functional/vimscript/msgpack_functions_spec.lua b/test/functional/vimscript/msgpack_functions_spec.lua
index d59dceef31..d2011f9fec 100644
--- a/test/functional/vimscript/msgpack_functions_spec.lua
+++ b/test/functional/vimscript/msgpack_functions_spec.lua
@@ -371,13 +371,14 @@ describe('msgpack*() functions', function()
eq(1, eval('dumped ==# dumped2'))
end)
- it('can restore and dump STR string with zero byte', function()
+ it('can restore and dump STR string contents with zero byte', function()
command('let dumped = ["\\xA1\\n"]')
command('let parsed = msgpackparse(dumped)')
command('let dumped2 = msgpackdump(parsed)')
- eq({ { _TYPE = {}, _VAL = { '\n' } } }, eval('parsed'))
- eq(1, eval('parsed[0]._TYPE is v:msgpack_types.string'))
- eq(1, eval('dumped ==# dumped2'))
+ eq({ '\000' }, eval('parsed'))
+ eq(eval('v:t_blob'), eval('type(parsed[0])'))
+ -- type is not preserved: prefer BIN for binary contents
+ eq(0, eval('dumped ==# dumped2'))
end)
it('can restore and dump BIN string with NL', function()
@@ -428,26 +429,24 @@ describe('msgpackparse() function', function()
parse_eq({ true }, { '\195' })
end)
- it('restores FIXSTR as special dict', function()
- parse_eq({ { _TYPE = {}, _VAL = { 'ab' } } }, { '\162ab' })
- eq(1, eval('g:parsed[0]._TYPE is v:msgpack_types.string'))
+ it('restores FIXSTR as string', function()
+ parse_eq({ 'ab' }, { '\162ab' })
end)
it('restores BIN 8 as string', function()
parse_eq({ 'ab' }, { '\196\002ab' })
end)
- it('restores FIXEXT1 as special dictionary', function()
+ it('restores FIXEXT1 as special dict', function()
parse_eq({ { _TYPE = {}, _VAL = { 0x10, { '', '' } } } }, { '\212\016', '' })
eq(1, eval('g:parsed[0]._TYPE is v:msgpack_types.ext'))
end)
- it('restores MAP with BIN key as special dictionary', function()
- parse_eq({ { _TYPE = {}, _VAL = { { 'a', '' } } } }, { '\129\196\001a\196\n' })
- eq(1, eval('g:parsed[0]._TYPE is v:msgpack_types.map'))
+ it('restores MAP with BIN key as ordinary dict', function()
+ parse_eq({ { a = '' } }, { '\129\196\001a\196\n' })
end)
- it('restores MAP with duplicate STR keys as special dictionary', function()
+ it('restores MAP with duplicate STR keys as special dict', function()
command('let dumped = ["\\x82\\xA1a\\xC4\\n\\xA1a\\xC4\\n"]')
-- FIXME Internal error bug, can't use parse_eq() here
command('silent! let parsed = msgpackparse(dumped)')
@@ -455,17 +454,17 @@ describe('msgpackparse() function', function()
{
_TYPE = {},
_VAL = {
- { { _TYPE = {}, _VAL = { 'a' } }, '' },
- { { _TYPE = {}, _VAL = { 'a' } }, '' },
+ { 'a', '' },
+ { 'a', '' },
},
},
}, eval('parsed'))
eq(1, eval('g:parsed[0]._TYPE is v:msgpack_types.map'))
- eq(1, eval('g:parsed[0]._VAL[0][0]._TYPE is v:msgpack_types.string'))
- eq(1, eval('g:parsed[0]._VAL[1][0]._TYPE is v:msgpack_types.string'))
+ eq(eval('v:t_string'), eval('type(g:parsed[0]._VAL[0][0])'))
+ eq(eval('v:t_string'), eval('type(g:parsed[0]._VAL[1][0])'))
end)
- it('restores MAP with MAP key as special dictionary', function()
+ it('restores MAP with MAP key as special dict', function()
parse_eq({ { _TYPE = {}, _VAL = { { {}, '' } } } }, { '\129\128\196\n' })
eq(1, eval('g:parsed[0]._TYPE is v:msgpack_types.map'))
end)
@@ -511,7 +510,7 @@ describe('msgpackparse() function', function()
)
end)
- it('fails to parse a dictionary', function()
+ it('fails to parse a dict', function()
eq(
'Vim(call):E899: Argument of msgpackparse() must be a List or Blob',
exc_exec('call msgpackparse({})')
@@ -765,7 +764,7 @@ describe('msgpackdump() function', function()
)
end)
- it('fails to dump a dictionary', function()
+ it('fails to dump a dict', function()
eq('Vim(call):E686: Argument of msgpackdump() must be a List', exc_exec('call msgpackdump({})'))
end)
@@ -802,7 +801,7 @@ describe('msgpackdump() function', function()
it('can dump NULL string', function()
dump_eq({ '\196\n' }, '[$XXX_UNEXISTENT_VAR_XXX]')
- dump_eq({ '\196\n' }, '[{"_TYPE": v:msgpack_types.binary, "_VAL": [$XXX_UNEXISTENT_VAR_XXX]}]')
+ dump_eq({ '\196\n' }, '[v:_null_blob]')
dump_eq({ '\160' }, '[{"_TYPE": v:msgpack_types.string, "_VAL": [$XXX_UNEXISTENT_VAR_XXX]}]')
end)
@@ -814,7 +813,7 @@ describe('msgpackdump() function', function()
eq({ '\144' }, eval('msgpackdump([v:_null_list])'))
end)
- it('can dump NULL dictionary', function()
+ it('can dump NULL dict', function()
eq({ '\128' }, eval('msgpackdump([v:_null_dict])'))
end)
end)
diff --git a/test/functional/vimscript/printf_spec.lua b/test/functional/vimscript/printf_spec.lua
index 3c66e07618..1fd5c3c9b6 100644
--- a/test/functional/vimscript/printf_spec.lua
+++ b/test/functional/vimscript/printf_spec.lua
@@ -84,10 +84,13 @@ describe('printf()', function()
end
api.nvim_del_var('__result')
end
+ check_printf('v:_null_string', true)
check_printf('v:_null_list', true)
check_printf('v:_null_dict', true)
+ check_printf('v:_null_blob', true)
check_printf('[]')
check_printf('{}')
+ check_printf('0z')
check_printf('function("tr", ["a"])')
end)
end)
diff --git a/test/functional/vimscript/server_spec.lua b/test/functional/vimscript/server_spec.lua
deleted file mode 100644
index 4b0dc087f6..0000000000
--- a/test/functional/vimscript/server_spec.lua
+++ /dev/null
@@ -1,199 +0,0 @@
-local t = require('test.testutil')
-local n = require('test.functional.testnvim')()
-
-local assert_log = t.assert_log
-local eq, neq, eval = t.eq, t.neq, n.eval
-local clear, fn, api = n.clear, n.fn, n.api
-local ok = t.ok
-local matches = t.matches
-local pcall_err = t.pcall_err
-local check_close = n.check_close
-local mkdir = t.mkdir
-local rmdir = n.rmdir
-local is_os = t.is_os
-
-local testlog = 'Xtest-server-log'
-
-local function clear_serverlist()
- for _, server in pairs(fn.serverlist()) do
- fn.serverstop(server)
- end
-end
-
-describe('server', function()
- after_each(function()
- check_close()
- os.remove(testlog)
- end)
-
- it('serverstart() stores sockets in $XDG_RUNTIME_DIR', function()
- local dir = 'Xtest_xdg_run'
- mkdir(dir)
- finally(function()
- rmdir(dir)
- end)
- clear({ env = { XDG_RUNTIME_DIR = dir } })
- matches(dir, fn.stdpath('run'))
- if not is_os('win') then
- matches(dir, fn.serverstart())
- end
- end)
-
- it('serverstart(), serverstop() does not set $NVIM', function()
- clear()
- local s = eval('serverstart()')
- assert(s ~= nil and s:len() > 0, 'serverstart() returned empty')
- eq('', eval('$NVIM'))
- eq('', eval('$NVIM_LISTEN_ADDRESS'))
- eq(1, eval("serverstop('" .. s .. "')"))
- eq('', eval('$NVIM_LISTEN_ADDRESS'))
- end)
-
- it('sets new v:servername if $NVIM_LISTEN_ADDRESS is invalid', function()
- clear({ env = { NVIM_LISTEN_ADDRESS = '.' } })
- -- Cleared on startup.
- eq('', eval('$NVIM_LISTEN_ADDRESS'))
- local servers = fn.serverlist()
- eq(1, #servers)
- ok(string.len(servers[1]) > 4) -- "~/.local/state/nvim…/…" or "\\.\pipe\…"
- end)
-
- it('sets v:servername at startup or if all servers were stopped', function()
- clear()
- local initial_server = api.nvim_get_vvar('servername')
- assert(initial_server ~= nil and initial_server:len() > 0, 'v:servername was not initialized')
-
- -- v:servername is readonly so we cannot unset it--but we can test that it
- -- does not get set again thereafter.
- local s = fn.serverstart()
- assert(s ~= nil and s:len() > 0, 'serverstart() returned empty')
- neq(initial_server, s)
-
- -- serverstop() does _not_ modify v:servername...
- eq(1, fn.serverstop(s))
- eq(initial_server, api.nvim_get_vvar('servername'))
-
- -- ...unless we stop _all_ servers.
- eq(1, fn.serverstop(fn.serverlist()[1]))
- eq('', api.nvim_get_vvar('servername'))
-
- -- v:servername and $NVIM take the next available server.
- local servername = (
- is_os('win') and [[\\.\pipe\Xtest-functional-server-pipe]]
- or './Xtest-functional-server-socket'
- )
- fn.serverstart(servername)
- eq(servername, api.nvim_get_vvar('servername'))
- -- Not set in the current process, only in children.
- eq('', eval('$NVIM'))
- end)
-
- it('serverstop() returns false for invalid input', function()
- clear { env = {
- NVIM_LOG_FILE = testlog,
- NVIM_LISTEN_ADDRESS = '.',
- } }
- eq(0, eval("serverstop('')"))
- eq(0, eval("serverstop('bogus-socket-name')"))
- assert_log('Not listening on bogus%-socket%-name', testlog, 10)
- end)
-
- it('parses endpoints', function()
- clear { env = {
- NVIM_LOG_FILE = testlog,
- NVIM_LISTEN_ADDRESS = '.',
- } }
- clear_serverlist()
- eq({}, fn.serverlist())
-
- local s = fn.serverstart('127.0.0.1:0') -- assign random port
- if #s > 0 then
- matches('127.0.0.1:%d+', s)
- eq(s, fn.serverlist()[1])
- clear_serverlist()
- end
-
- s = fn.serverstart('127.0.0.1:') -- assign random port
- if #s > 0 then
- matches('127.0.0.1:%d+', s)
- eq(s, fn.serverlist()[1])
- clear_serverlist()
- end
-
- local expected = {}
- local v4 = '127.0.0.1:12345'
- local status, _ = pcall(fn.serverstart, v4)
- if status then
- table.insert(expected, v4)
- pcall(fn.serverstart, v4) -- exists already; ignore
- assert_log('Failed to start server: address already in use: 127%.0%.0%.1', testlog, 10)
- end
-
- local v6 = '::1:12345'
- status, _ = pcall(fn.serverstart, v6)
- if status then
- table.insert(expected, v6)
- pcall(fn.serverstart, v6) -- exists already; ignore
- assert_log('Failed to start server: address already in use: ::1', testlog, 10)
- end
- eq(expected, fn.serverlist())
- clear_serverlist()
-
- -- Address without slashes is a "name" which is appended to a generated path. #8519
- matches([[.*[/\\]xtest1%.2%.3%.4[^/\\]*]], fn.serverstart('xtest1.2.3.4'))
- clear_serverlist()
-
- eq('Vim:Failed to start server: invalid argument', pcall_err(fn.serverstart, '127.0.0.1:65536')) -- invalid port
- eq({}, fn.serverlist())
- end)
-
- it('serverlist() returns the list of servers', function()
- clear()
- -- There should already be at least one server.
- local _n = eval('len(serverlist())')
-
- -- Add some servers.
- local servs = (
- is_os('win') and { [[\\.\pipe\Xtest-pipe0934]], [[\\.\pipe\Xtest-pipe4324]] }
- or { [[./Xtest-pipe0934]], [[./Xtest-pipe4324]] }
- )
- for _, s in ipairs(servs) do
- eq(s, eval("serverstart('" .. s .. "')"))
- end
-
- local new_servs = eval('serverlist()')
-
- -- Exactly #servs servers should be added.
- eq(_n + #servs, #new_servs)
- -- The new servers should be at the end of the list.
- for i = 1, #servs do
- eq(servs[i], new_servs[i + _n])
- eq(1, eval("serverstop('" .. servs[i] .. "')"))
- end
- -- After serverstop() the servers should NOT be in the list.
- eq(_n, eval('len(serverlist())'))
- end)
-end)
-
-describe('startup --listen', function()
- it('validates', function()
- clear()
- local cmd = { unpack(n.nvim_argv) }
- table.insert(cmd, '--listen')
- matches('nvim.*: Argument missing after: "%-%-listen"', fn.system(cmd))
-
- cmd = { unpack(n.nvim_argv) }
- table.insert(cmd, '--listen2')
- matches('nvim.*: Garbage after option argument: "%-%-listen2"', fn.system(cmd))
- end)
-
- it('sets v:servername, overrides $NVIM_LISTEN_ADDRESS', function()
- local addr = (is_os('win') and [[\\.\pipe\Xtest-listen-pipe]] or './Xtest-listen-pipe')
- clear({ env = { NVIM_LISTEN_ADDRESS = './Xtest-env-pipe' }, args = { '--listen', addr } })
- eq(addr, api.nvim_get_vvar('servername'))
-
- -- Address without slashes is a "name" which is appended to a generated path. #8519
- clear({ args = { '--listen', 'test-name' } })
- matches([[.*[/\\]test%-name[^/\\]*]], api.nvim_get_vvar('servername'))
- end)
-end)
diff --git a/test/functional/vimscript/string_spec.lua b/test/functional/vimscript/string_spec.lua
index 32aa04c0d0..4df9104e1e 100644
--- a/test/functional/vimscript/string_spec.lua
+++ b/test/functional/vimscript/string_spec.lua
@@ -170,9 +170,9 @@ describe('string() function', function()
)
end)
- it('does not show errors when dumping partials referencing the same dictionary', function()
+ it('does not show errors when dumping partials referencing the same dict', function()
command('let d = {}')
- -- Regression for “eval/typval_encode: Dump empty dictionary before
+ -- Regression for “eval/typval_encode: Dump empty dict before
-- checking for refcycle”, results in error.
eq(
"[function('tr', {}), function('tr', {})]",
@@ -256,7 +256,7 @@ describe('string() function', function()
end)
describe('used to represent dictionaries', function()
- it('dumps empty dictionary', function()
+ it('dumps empty dict', function()
eq('{}', eval('string({})'))
end)
@@ -267,7 +267,7 @@ describe('string() function', function()
eq("[{}, function('tr', {})]", eval('string([d, function("tr", d)])'))
end)
- it('dumps non-empty dictionary', function()
+ it('dumps non-empty dict', function()
eq("{'t''est': 1}", fn.string({ ["t'est"] = 1 }))
end)