aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-26 18:41:59 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-01 07:23:04 -0400
commit3b04ba7544cf78ab4d9e7e9ee4536a2e7a916fe6 (patch)
tree6271476bb40acbde9f26d2c894c8e26d150f773a /src/nvim/testdir
parenta177820420d3de1614bff01321c0a54a2327fab3 (diff)
downloadrneovim-3b04ba7544cf78ab4d9e7e9ee4536a2e7a916fe6.tar.gz
rneovim-3b04ba7544cf78ab4d9e7e9ee4536a2e7a916fe6.tar.bz2
rneovim-3b04ba7544cf78ab4d9e7e9ee4536a2e7a916fe6.zip
vim-patch:8.2.2655: The -w command line argument doesn't work
Problem: The -w command line argument doesn't work. Solution: Don't set 'window' when set with the -w argument. (closes vim/vim#8011) https://github.com/vim/vim/commit/0a1a6a1aa4004d0e4d64cc375540156b8bd92a87 Cherry-pick Test_w_arg() from patch v8.2.0509.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_startup.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim
index eb9378194f..63affd6910 100644
--- a/src/nvim/testdir/test_startup.vim
+++ b/src/nvim/testdir/test_startup.vim
@@ -890,6 +890,36 @@ func Test_not_a_term()
endfunc
+" Test for the "-w scriptout" argument
+func Test_w_arg()
+ " Can't catch the output of gvim.
+ CheckNotGui
+
+ call writefile(["iVim Editor\<Esc>:q!\<CR>"], 'Xscriptin', 'b')
+ if RunVim([], [], '-s Xscriptin -w Xscriptout')
+ call assert_equal(["iVim Editor\e:q!\r"], readfile('Xscriptout'))
+ call delete('Xscriptout')
+ endif
+ call delete('Xscriptin')
+
+ " Test for failing to open the script output file. This test works only when
+ " the language is English.
+ if v:lang == "C" || v:lang =~ '^[Ee]n'
+ call mkdir("Xdir")
+ let m = system(GetVimCommand() .. " -w Xdir")
+ call assert_equal("Cannot open for script output: \"Xdir\"\n", m)
+ call delete("Xdir", 'rf')
+ endif
+
+ " A number argument sets the 'window' option
+ call writefile(["iwindow \<C-R>=&window\<CR>\<Esc>:wq! Xresult\<CR>"], 'Xscriptin', 'b')
+ if RunVim([], [], '-s Xscriptin -w 17')
+ call assert_equal(["window 17"], readfile('Xresult'))
+ call delete('Xresult')
+ endif
+ call delete('Xscriptin')
+endfunc
+
" Test starting vim with various names: vim, ex, view, evim, etc.
func Test_progname()
CheckUnix