comparison src/testdir/test_options.vim @ 10420:7a631c6b0a20 v8.0.0104

commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 26 17:45:53 2016 +0100 patch 8.0.0104 Problem: Value of 'thesaurus' option not checked properly. Solution: Add P_NDNAME flag. (Daisuke Suzuki)
author Christian Brabandt <cb@256bit.org>
date Sat, 26 Nov 2016 18:00:04 +0100
parents ef5474130b0e
children a7da553980ee
comparison
equal deleted inserted replaced
10419:922418f4ca6c 10420:7a631c6b0a20
105 105
106 call assert_fails(":set kmp=trunc\x00name", "E544:") 106 call assert_fails(":set kmp=trunc\x00name", "E544:")
107 call assert_fails(":set kmp=trunc\x00name", "trunc") 107 call assert_fails(":set kmp=trunc\x00name", "trunc")
108 endfunc 108 endfunc
109 109
110 func Test_dictionary() 110 func Check_dir_option(name)
111 " Check that it's possible to set the option. 111 " Check that it's possible to set the option.
112 set dictionary=/usr/share/dict/words 112 exe 'set ' . a:name . '=/usr/share/dict/words'
113 call assert_equal('/usr/share/dict/words', &dictionary) 113 call assert_equal('/usr/share/dict/words', eval('&' . a:name))
114 set dictionary=/usr/share/dict/words,/and/there 114 exe 'set ' . a:name . '=/usr/share/dict/words,/and/there'
115 call assert_equal('/usr/share/dict/words,/and/there', &dictionary) 115 call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name))
116 set dictionary=/usr/share/dict\ words 116 exe 'set ' . a:name . '=/usr/share/dict\ words'
117 call assert_equal('/usr/share/dict words', &dictionary) 117 call assert_equal('/usr/share/dict words', eval('&' . a:name))
118 118
119 " Check rejecting weird characters. 119 " Check rejecting weird characters.
120 call assert_fails("set dictionary=/not&there", "E474:") 120 call assert_fails("set " . a:name . "=/not&there", "E474:")
121 call assert_fails("set dictionary=/not>there", "E474:") 121 call assert_fails("set " . a:name . "=/not>there", "E474:")
122 call assert_fails("set dictionary=/not.*there", "E474:") 122 call assert_fails("set " . a:name . "=/not.*there", "E474:")
123 endfunc 123 endfunc
124
125 func Test_dictionary()
126 call Check_dir_option('dictionary')
127 endfunc
128
129 func Test_thesaurus()
130 call Check_dir_option('thesaurus')
131 endfunc