diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-01-28 11:33:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-28 11:33:56 +0100 |
commit | 16a6f445702804a406244a129b0b3ec6d546b37d (patch) | |
tree | a92a23ed9908bc974994c4e95ecf36046701ff66 | |
parent | c6fe06bbc09c0adbb3ef30be9f5b238e802b5038 (diff) | |
parent | 5d88830d51100a69126e9aa31bbd50574923cb05 (diff) | |
download | rneovim-16a6f445702804a406244a129b0b3ec6d546b37d.tar.gz rneovim-16a6f445702804a406244a129b0b3ec6d546b37d.tar.bz2 rneovim-16a6f445702804a406244a129b0b3ec6d546b37d.zip |
Merge #7903 'test/old: minor fixes for local invocation'
-rw-r--r-- | src/nvim/testdir/Makefile | 3 | ||||
-rw-r--r-- | src/nvim/testdir/shared.vim | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_normal.vim | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 2dc42be652..5a6e03f182 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -7,12 +7,11 @@ ifeq ($(OS),Windows_NT) else NVIM_PRG ?= ../../../build/bin/nvim endif -TMPDIR ?= Xtest-tmpdir SCRIPTSOURCE := ../../../runtime export SHELL := sh export NVIM_PRG := $(NVIM_PRG) -export TMPDIR +export TMPDIR := Xtest-tmpdir SCRIPTS_DEFAULT = \ test14.out \ diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index d8e2d1d718..4925b04a82 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -9,8 +9,12 @@ func! Fix_truncated_tmpfile(fname) if $TMPDIR ==# '' throw '$TMPDIR is empty' endif - if a:fname !~# $TMPDIR - throw '$TMPDIR not in fname: '.a:fname + let tmpdir_tail = fnamemodify(substitute($TMPDIR, '[\/]\+$', '', 'g'), ':t') + if tmpdir_tail ==# '' + throw 'empty tmpdir_tail' + endif + if a:fname !~# tmpdir_tail + throw printf('$TMPDIR (%s) not in fname: %s', tmpdir_tail, a:fname) endif let last2segments = matchstr(a:fname, '[\/][^\/]\+[\/][^\/]\+$') return $TMPDIR.last2segments diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index c28d76e66f..307f62e17a 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -1075,7 +1075,6 @@ func! Test_normal19_z_spell() 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 @@ -1122,7 +1121,6 @@ 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) |