aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/main_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/core/main_spec.lua')
-rw-r--r--test/functional/core/main_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/core/main_spec.lua b/test/functional/core/main_spec.lua
index 5e903726db..a6e917b4b2 100644
--- a/test/functional/core/main_spec.lua
+++ b/test/functional/core/main_spec.lua
@@ -193,4 +193,26 @@ describe('command-line option', function()
matches('Run "nvim %-V1 %-v"', fn.system({ nvim_prog_abs(), '-v' }))
matches('Compilation: .*Run :checkhealth', fn.system({ nvim_prog_abs(), '-V1', '-v' }))
end)
+
+ if is_os('win') then
+ for _, prefix in ipairs({ '~/', '~\\' }) do
+ it('expands ' .. prefix .. ' on Windows', function()
+ local fname = os.getenv('USERPROFILE') .. '\\nvim_test.txt'
+ finally(function()
+ os.remove(fname)
+ end)
+ write_file(fname, 'some text')
+ eq(
+ 'some text',
+ fn.system({
+ nvim_prog_abs(),
+ '-es',
+ '+%print',
+ '+q',
+ prefix .. 'nvim_test.txt',
+ }):gsub('\n', '')
+ )
+ end)
+ end
+ end
end)