aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-01-13 19:59:05 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-01-15 23:58:52 +0100
commit2b1bcd446b6d95f608161818addecf7c6a2beeaa (patch)
tree605d17f83276ef93f4c0dca40004a0ad6c8d7eb4
parent8eb0888a5de2481e15fcae63fa477f0ac634c9f2 (diff)
downloadrneovim-2b1bcd446b6d95f608161818addecf7c6a2beeaa.tar.gz
rneovim-2b1bcd446b6d95f608161818addecf7c6a2beeaa.tar.bz2
rneovim-2b1bcd446b6d95f608161818addecf7c6a2beeaa.zip
runtime: include en.utf-8.spl
Install en.utf-8.spl by default. - Allows spell-related tests to run. - Avoids download prompt for spelllang=en users
-rw-r--r--runtime/CMakeLists.txt2
-rw-r--r--runtime/spell/en.utf-8.splbin0 -> 609337 bytes
-rw-r--r--src/nvim/testdir/shared.vim16
-rw-r--r--src/nvim/testdir/test_normal.vim6
-rw-r--r--src/nvim/testdir/test_spell.vim2
5 files changed, 23 insertions, 3 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index d992c2cc77..0172f630cd 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -138,7 +138,7 @@ endforeach()
file(GLOB_RECURSE RUNTIME_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
rgb.txt
- *.vim *.lua *.dict *.py *.rb *.ps *.tutor *.tutor.json)
+ *.vim *.lua *.dict *.py *.rb *.ps *.spl *.tutor *.tutor.json)
foreach(F ${RUNTIME_FILES})
get_filename_component(BASEDIR ${F} PATH)
diff --git a/runtime/spell/en.utf-8.spl b/runtime/spell/en.utf-8.spl
new file mode 100644
index 0000000000..83b9b8f7c2
--- /dev/null
+++ b/runtime/spell/en.utf-8.spl
Binary files differ
diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim
index 72cfea96c6..d8e2d1d718 100644
--- a/src/nvim/testdir/shared.vim
+++ b/src/nvim/testdir/shared.vim
@@ -1,5 +1,21 @@
" Functions shared by several tests.
+" {Nvim}
+" Filepath captured from output may be truncated, like this:
+" /home/va...estdir/Xtest-tmpdir/nvimxbXN4i/10
+" Get last 2 segments, then combine with $TMPDIR.
+func! Fix_truncated_tmpfile(fname)
+ " sanity check
+ if $TMPDIR ==# ''
+ throw '$TMPDIR is empty'
+ endif
+ if a:fname !~# $TMPDIR
+ throw '$TMPDIR not in fname: '.a:fname
+ endif
+ let last2segments = matchstr(a:fname, '[\/][^\/]\+[\/][^\/]\+$')
+ return $TMPDIR.last2segments
+endfunc
+
" Get the name of the Python executable.
" Also keeps it in s:python.
func PythonProg()
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index 4747d5704d..8635daa7ad 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -1,5 +1,7 @@
" Test for various Normal mode commands
+source shared.vim
+
func! Setup_NewWindow()
10new
call setline(1, range(1,100))
@@ -1069,10 +1071,10 @@ func! Test_normal18_z_fold()
endfunc
func! Test_normal19_z_spell()
- throw "skipped: Nvim 'spell' requires download"
if !has("spell") || !has('syntax')
return
endif
+ " let $TMPDIR=fnamemodify($TMPDIR, ':.')
new
call append(0, ['1 good', '2 goood', '3 goood'])
set spell spellfile=./Xspellfile.add spelllang=en
@@ -1119,7 +1121,9 @@ func! Test_normal19_z_spell()
" Test for zG
let a=execute('unsilent norm! V$zG')
call assert_match("Word '2 goood' added to .*", a)
+ set shortmess=
let fname=matchstr(a, 'to\s\+\zs\f\+$')
+ let fname=Fix_truncated_tmpfile(fname)
let cnt=readfile(fname)
call assert_equal('2 goood', cnt[0])
diff --git a/src/nvim/testdir/test_spell.vim b/src/nvim/testdir/test_spell.vim
index 66be5c2441..0688d615e7 100644
--- a/src/nvim/testdir/test_spell.vim
+++ b/src/nvim/testdir/test_spell.vim
@@ -1,7 +1,7 @@
" Test spell checking
" TODO: move test58 tests here
-if v:true
+if !has('spell')
finish
endif