aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/startup_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-09-08 21:29:20 +0200
committerJustin M. Keyes <justinkz@gmail.com>2024-09-09 12:23:54 +0200
commited832b9ddf45705abe9d7f4a50cedc27072c8e16 (patch)
treedaea0210246a4cd204ee89e9850c93cbf054f1f3 /test/functional/core/startup_spec.lua
parent8a2aec99748229ad9d1e12c1cbc0768d063e8eed (diff)
downloadrneovim-ed832b9ddf45705abe9d7f4a50cedc27072c8e16.tar.gz
rneovim-ed832b9ddf45705abe9d7f4a50cedc27072c8e16.tar.bz2
rneovim-ed832b9ddf45705abe9d7f4a50cedc27072c8e16.zip
refactor(test): rename alter_slashes, invert its behavior
- `alter_slashes` belongs in `testutil.lua`, not `testnvim.lua`. - `alter_slashes` is an unusual name. Rename it to `fix_slashes`. - invert its behavior, to emphasize that `/` slashes are the preferred, pervasive convention, not `\` slashes.
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r--test/functional/core/startup_spec.lua20
1 files changed, 6 insertions, 14 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index 8d6ba9712a..f48bcb9360 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -27,7 +27,6 @@ local sleep = vim.uv.sleep
local startswith = vim.startswith
local write_file = t.write_file
local api = n.api
-local alter_slashes = n.alter_slashes
local is_os = t.is_os
local dedent = t.dedent
local tbl_map = vim.tbl_map
@@ -40,22 +39,15 @@ local testlog = 'Xtest-startupspec-log'
describe('startup', function()
it('--clean', function()
clear()
- ok(
- string.find(
- alter_slashes(api.nvim_get_option_value('runtimepath', {})),
- fn.stdpath('config'),
- 1,
- true
- ) ~= nil
+ matches(
+ vim.pesc(t.fix_slashes(fn.stdpath('config'))),
+ t.fix_slashes(api.nvim_get_option_value('runtimepath', {}))
)
+
clear('--clean')
ok(
- string.find(
- alter_slashes(api.nvim_get_option_value('runtimepath', {})),
- fn.stdpath('config'),
- 1,
- true
- ) == nil
+ not t.fix_slashes(api.nvim_get_option_value('runtimepath', {}))
+ :match(vim.pesc(t.fix_slashes(fn.stdpath('config'))))
)
end)