summaryrefslogtreecommitdiff
path: root/src/testdir/test_spell.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-18 19:32:26 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-18 19:32:26 +0100
commit8dfcce3a78ccb520cc9d09081f998091494c50bf (patch)
tree7e3412f192510c58f5a435ee66eab1d34606cdc0 /src/testdir/test_spell.vim
parent3cdcb090a664e182078f7cc0ca3e4e5a94bbb784 (diff)
downloadvim-git-8dfcce3a78ccb520cc9d09081f998091494c50bf.tar.gz
patch 8.2.0401: not enough test coverage for evalvars.cv8.2.0401
Problem: Not enough test coverage for evalvars.c. Solution: Add more tests. (Yegappan Lakshmanan, closes #5804)
Diffstat (limited to 'src/testdir/test_spell.vim')
-rw-r--r--src/testdir/test_spell.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim
index 0ebf33adf..5755146e0 100644
--- a/src/testdir/test_spell.vim
+++ b/src/testdir/test_spell.vim
@@ -298,6 +298,35 @@ func Test_spellsuggest_option_expr()
bwipe!
endfunc
+" Test for 'spellsuggest' expr errrors
+func Test_spellsuggest_expr_errors()
+ " 'spellsuggest'
+ func MySuggest()
+ return range(3)
+ endfunc
+ set spell spellsuggest=expr:MySuggest()
+ call assert_equal([], spellsuggest('baord', 3))
+
+ " Test for 'spellsuggest' expression returning a non-list value
+ func! MySuggest2()
+ return 'good'
+ endfunc
+ set spellsuggest=expr:MySuggest2()
+ call assert_equal([], spellsuggest('baord'))
+
+ " Test for 'spellsuggest' expression returning a list with dict values
+ func! MySuggest3()
+ return [[{}, {}]]
+ endfunc
+ set spellsuggest=expr:MySuggest3()
+ call assert_fails("call spellsuggest('baord')", 'E728:')
+
+ set nospell spellsuggest&
+ delfunc MySuggest
+ delfunc MySuggest2
+ delfunc MySuggest3
+endfunc
+
func Test_spellinfo()
new
let runtime = substitute($VIMRUNTIME, '\\', '/', 'g')