comparison src/testdir/test_options.vim @ 24596:acd9220bdd0b v8.2.2837

patch 8.2.2837: various code lines not covered by tests Commit: https://github.com/vim/vim/commit/6d37e8e3baafba460bd2d051170d213c1ba9a523 Author: Dominique Pelle <dominique.pelle@gmail.com> Date: Thu May 6 17:36:55 2021 +0200 patch 8.2.2837: various code lines not covered by tests Problem: Various code lines not covered by tests. Solution: Add test cases. (Dominique Pell?, closes https://github.com/vim/vim/issues/8178)
author Bram Moolenaar <Bram@vim.org>
date Thu, 06 May 2021 17:45:04 +0200
parents 0a5eba7e6660
children 4c1b6f3eb96b
comparison
equal deleted inserted replaced
24595:cc93bd42e6b3 24596:acd9220bdd0b
1091 1091
1092 " clean up 1092 " clean up
1093 call delete('Xscroll') 1093 call delete('Xscroll')
1094 endfunc 1094 endfunc
1095 1095
1096 " Check that VIM_POSIX env variable influences default value of 'cpo' and 'shm'
1097 func Test_VIM_POSIX()
1098 let saved_VIM_POSIX = getenv("VIM_POSIX")
1099
1100 call setenv('VIM_POSIX', "1")
1101 let after =<< trim [CODE]
1102 call writefile([&cpo, &shm], 'X_VIM_POSIX')
1103 qall
1104 [CODE]
1105 if RunVim([], after, '')
1106 call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>#{|&/\.;',
1107 \ 'AS'], readfile('X_VIM_POSIX'))
1108 endif
1109
1110 call setenv('VIM_POSIX', v:null)
1111 let after =<< trim [CODE]
1112 call writefile([&cpo, &shm], 'X_VIM_POSIX')
1113 qall
1114 [CODE]
1115 if RunVim([], after, '')
1116 call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;',
1117 \ 'S'], readfile('X_VIM_POSIX'))
1118 endif
1119
1120 call delete('X_VIM_POSIX')
1121 call setenv('VIM_POSIX', saved_VIM_POSIX)
1122 endfunc
1123
1096 " vim: shiftwidth=2 sts=2 expandtab 1124 " vim: shiftwidth=2 sts=2 expandtab