summaryrefslogtreecommitdiff
path: root/src/testdir/test_options.vim
diff options
context:
space:
mode:
authorDominique Pelle <dominique.pelle@gmail.com>2021-05-06 17:36:55 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-06 17:36:55 +0200
commit6d37e8e3baafba460bd2d051170d213c1ba9a523 (patch)
treed53ed8ddd30c91ce598262e88f7430de8d81a358 /src/testdir/test_options.vim
parentb7c978154e0816f4dcfae8a06b4ba1bfb7f796f6 (diff)
downloadvim-git-6d37e8e3baafba460bd2d051170d213c1ba9a523.tar.gz
patch 8.2.2837: various code lines not covered by testsv8.2.2837
Problem: Various code lines not covered by tests. Solution: Add test cases. (Dominique Pellé, closes #8178)
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r--src/testdir/test_options.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index 54042d42f..d789a461e 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -1093,4 +1093,32 @@ func Test_opt_reset_scroll()
call delete('Xscroll')
endfunc
+" Check that VIM_POSIX env variable influences default value of 'cpo' and 'shm'
+func Test_VIM_POSIX()
+ let saved_VIM_POSIX = getenv("VIM_POSIX")
+
+ call setenv('VIM_POSIX', "1")
+ let after =<< trim [CODE]
+ call writefile([&cpo, &shm], 'X_VIM_POSIX')
+ qall
+ [CODE]
+ if RunVim([], after, '')
+ call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>#{|&/\.;',
+ \ 'AS'], readfile('X_VIM_POSIX'))
+ endif
+
+ call setenv('VIM_POSIX', v:null)
+ let after =<< trim [CODE]
+ call writefile([&cpo, &shm], 'X_VIM_POSIX')
+ qall
+ [CODE]
+ if RunVim([], after, '')
+ call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;',
+ \ 'S'], readfile('X_VIM_POSIX'))
+ endif
+
+ call delete('X_VIM_POSIX')
+ call setenv('VIM_POSIX', saved_VIM_POSIX)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab