@@ -107,17 +107,25 @@ func Test_keymap_valid()
107107 call assert_fails (" :set kmp=trunc\x00 name" , " trunc" )
108108endfunc
109109
110- func Test_dictionary ( )
110+ func Check_dir_option (name )
111111 " Check that it's possible to set the option.
112- set dictionary = /usr/ share/dict/ words
113- call assert_equal (' /usr/share/dict/words' , & dictionary )
114- set dictionary = /usr/ share/dict/ words,/and/ there
115- call assert_equal (' /usr/share/dict/words,/and/there' , & dictionary )
116- set dictionary = /usr/ share/dict \ words
117- call assert_equal (' /usr/share/dict words' , & dictionary )
112+ exe ' set ' . a: name . ' =/usr/share/dict/words'
113+ call assert_equal (' /usr/share/dict/words' , eval ( ' & ' . a: name ) )
114+ exe ' set ' . a: name . ' =/usr/share/dict/words,/and/there'
115+ call assert_equal (' /usr/share/dict/words,/and/there' , eval ( ' & ' . a: name ) )
116+ exe ' set ' . a: name . ' =/usr/share/dict\ words'
117+ call assert_equal (' /usr/share/dict words' , eval ( ' & ' . a: name ) )
118118
119119 " Check rejecting weird characters.
120- call assert_fails (" set dictionary=/not&there" , " E474:" )
121- call assert_fails (" set dictionary=/not>there" , " E474:" )
122- call assert_fails (" set dictionary=/not.*there" , " E474:" )
120+ call assert_fails (" set " . a: name . " =/not&there" , " E474:" )
121+ call assert_fails (" set " . a: name . " =/not>there" , " E474:" )
122+ call assert_fails (" set " . a: name . " =/not.*there" , " E474:" )
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' )
123131endfunc
0 commit comments