aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_options.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-27 10:10:11 -0400
committerGitHub <noreply@github.com>2021-03-27 10:10:11 -0400
commit75a9db5b7d60c016a950dac7f0a0932e7d7c6df8 (patch)
treeec4c92e7763b803f376a16d23a3420d1497f53a2 /src/nvim/testdir/test_options.vim
parentf0ace6d419380907b719edd2ea1d2256e92beb84 (diff)
parent9118bf191e1657732bdd5cb5fb1f98dc17cf7f41 (diff)
downloadrneovim-75a9db5b7d60c016a950dac7f0a0932e7d7c6df8.tar.gz
rneovim-75a9db5b7d60c016a950dac7f0a0932e7d7c6df8.tar.bz2
rneovim-75a9db5b7d60c016a950dac7f0a0932e7d7c6df8.zip
Merge pull request #14223 from janlazo/vim-8.2.2659
vim-patch:8.2.{1666,2045,2659,2662}
Diffstat (limited to 'src/nvim/testdir/test_options.vim')
-rw-r--r--src/nvim/testdir/test_options.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim
index 07e2481f95..5aef33cb09 100644
--- a/src/nvim/testdir/test_options.vim
+++ b/src/nvim/testdir/test_options.vim
@@ -448,6 +448,36 @@ func Test_backupskip()
endif
endfor
+ " Duplicates from environment variables should be filtered out (option has
+ " P_NODUP). Run this in a separate instance and write v:errors in a file,
+ " so that we see what happens on startup.
+ let after =<< trim [CODE]
+ let bsklist = split(&backupskip, ',')
+ call assert_equal(uniq(copy(bsklist)), bsklist)
+ call writefile(['errors:'] + v:errors, 'Xtestout')
+ qall
+ [CODE]
+ call writefile(after, 'Xafter')
+ " let cmd = GetVimProg() . ' --not-a-term -S Xafter --cmd "set enc=utf8"'
+ let cmd = GetVimProg() . ' -S Xafter --cmd "set enc=utf8"'
+
+ let saveenv = {}
+ for var in ['TMPDIR', 'TMP', 'TEMP']
+ let saveenv[var] = getenv(var)
+ call setenv(var, '/duplicate/path')
+ endfor
+
+ exe 'silent !' . cmd
+ call assert_equal(['errors:'], readfile('Xtestout'))
+
+ " restore environment variables
+ for var in ['TMPDIR', 'TMP', 'TEMP']
+ call setenv(var, saveenv[var])
+ endfor
+
+ call delete('Xtestout')
+ call delete('Xafter')
+
" Duplicates should be filtered out (option has P_NODUP)
let backupskip = &backupskip
set backupskip=