aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_options.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_options.vim')
-rw-r--r--src/nvim/testdir/test_options.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim
index 8a9d793a2e..08ee00e352 100644
--- a/src/nvim/testdir/test_options.vim
+++ b/src/nvim/testdir/test_options.vim
@@ -104,6 +104,29 @@ func Test_keymap_valid()
call assert_fails(":set kmp=trunc\x00name", "trunc")
endfunc
+func Check_dir_option(name)
+ " Check that it's possible to set the option.
+ exe 'set ' . a:name . '=/usr/share/dict/words'
+ call assert_equal('/usr/share/dict/words', eval('&' . a:name))
+ exe 'set ' . a:name . '=/usr/share/dict/words,/and/there'
+ call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name))
+ exe 'set ' . a:name . '=/usr/share/dict\ words'
+ call assert_equal('/usr/share/dict words', eval('&' . a:name))
+
+ " Check rejecting weird characters.
+ call assert_fails("set " . a:name . "=/not&there", "E474:")
+ call assert_fails("set " . a:name . "=/not>there", "E474:")
+ call assert_fails("set " . a:name . "=/not.*there", "E474:")
+endfunc
+
+func Test_dictionary()
+ call Check_dir_option('dictionary')
+endfunc
+
+func Test_thesaurus()
+ call Check_dir_option('thesaurus')
+endfunc
+
func Test_complete()
" Trailing single backslash used to cause invalid memory access.
set complete=s\