diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-27 13:58:38 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-27 13:58:38 +0200 |
commit | 8c7ad3631af570f68b2da2658cf966a9a19cb6c4 (patch) | |
tree | 51e1cf3a6adeb2b3ccbdb8988a4f97c8ae1669e4 /src/testdir | |
parent | f6a44f714a383a69db05cb47e26abffd966cd6a5 (diff) | |
download | vim-git-8c7ad3631af570f68b2da2658cf966a9a19cb6c4.tar.gz |
patch 8.2.1754: completion with spell checking not testedv8.2.1754
Problem: Completion with spell checking not tested.
Solution: Add a test case. (Dominique Pellé, closes #7024)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_spell.vim | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim index 4beff9a1a..db40cd24a 100644 --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim @@ -120,6 +120,43 @@ foobar/? set spell& endfunc +func Test_spelllang_inv_region() + set spell spelllang=en_xx + let messages = GetMessages() + call assert_equal('Warning: region xx not supported', messages[-1]) + set spell& spelllang& +endfunc + +func Test_compl_with_CTRL_X_CTRL_K_using_spell() + " When spell checking is enabled and 'dictionary' is empty, + " CTRL-X CTRL-K in insert mode completes using the spelling dictionary. + new + set spell spelllang=en dictionary= + + set ignorecase + call feedkeys("Senglis\<c-x>\<c-k>\<esc>", 'tnx') + call assert_equal(['English'], getline(1, '$')) + call feedkeys("SEnglis\<c-x>\<c-k>\<esc>", 'tnx') + call assert_equal(['English'], getline(1, '$')) + + set noignorecase + call feedkeys("Senglis\<c-x>\<c-k>\<esc>", 'tnx') + call assert_equal(['englis'], getline(1, '$')) + call feedkeys("SEnglis\<c-x>\<c-k>\<esc>", 'tnx') + call assert_equal(['English'], getline(1, '$')) + + set spelllang=en_us + call feedkeys("Stheat\<c-x>\<c-k>\<esc>", 'tnx') + call assert_equal(['theater'], getline(1, '$')) + set spelllang=en_gb + call feedkeys("Stheat\<c-x>\<c-k>\<esc>", 'tnx') + " FIXME: commented out, expected theatre bug got theater. See issue #7025. + " call assert_equal(['theatre'], getline(1, '$')) + + bwipe! + set spell& spelllang& dictionary& ignorecase& +endfunc + func Test_spellreall() new set spell |