aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-07-19 18:41:40 +0200
committerGitHub <noreply@github.com>2020-07-19 18:41:40 +0200
commitdaa5bffd93e19987980705990615c730fe07ea5f (patch)
tree38e422d674d51d0a4c0fb49a4fb2d0423ec9d6d7 /src/nvim/testdir
parent8e350c1c6922f9c678e83d97227e7edd84967571 (diff)
parent140a372017c7649e156742622c9ccc1cd8b794c1 (diff)
downloadrneovim-daa5bffd93e19987980705990615c730fe07ea5f.tar.gz
rneovim-daa5bffd93e19987980705990615c730fe07ea5f.tar.bz2
rneovim-daa5bffd93e19987980705990615c730fe07ea5f.zip
Merge pull request #12611 from janlazo/vim-8.0.1531
vim-patch:8.0.{1531,1544,1589,1591,1712,1745,1747},8.1.{819},8.2.{420,539,893,894,895,899,1114,1118,1169,1170,1171,1172,1173,1177,1179,1180,1181,1187,1188,1196,1198,1211,1214,1215,1222}
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/shared.vim2
-rw-r--r--src/nvim/testdir/test_assert.vim13
-rw-r--r--src/nvim/testdir/test_diffmode.vim22
-rw-r--r--src/nvim/testdir/test_registers.vim18
4 files changed, 53 insertions, 2 deletions
diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim
index b041fdedb1..41ff9b2bd6 100644
--- a/src/nvim/testdir/shared.vim
+++ b/src/nvim/testdir/shared.vim
@@ -275,7 +275,7 @@ func GetVimCommand(...)
" If using valgrind, make sure every run uses a different log file.
if cmd =~ 'valgrind.*--log-file='
- let cmd = substitute(cmd, '--log-file=\(^\s*\)', '--log-file=\1.' . g:valgrind_cnt, '')
+ let cmd = substitute(cmd, '--log-file=\(\S*\)', '--log-file=\1.' . g:valgrind_cnt, '')
let g:valgrind_cnt += 1
endif
diff --git a/src/nvim/testdir/test_assert.vim b/src/nvim/testdir/test_assert.vim
index 4cc90eca7a..b4f7478807 100644
--- a/src/nvim/testdir/test_assert.vim
+++ b/src/nvim/testdir/test_assert.vim
@@ -28,7 +28,18 @@ func Test_assert_equalfile()
call writefile(['1234X89'], 'Xone')
call writefile(['1234Y89'], 'Xtwo')
call assert_equal(1, assert_equalfile('Xone', 'Xtwo'))
- call assert_match("difference at byte 4", v:errors[0])
+ call assert_match('difference at byte 4, line 1 after "1234X" vs "1234Y"', v:errors[0])
+ call remove(v:errors, 0)
+
+ call writefile([repeat('x', 234) .. 'X'], 'Xone')
+ call writefile([repeat('x', 234) .. 'Y'], 'Xtwo')
+ call assert_equal(1, assert_equalfile('Xone', 'Xtwo'))
+ let xes = repeat('x', 134)
+ call assert_match('difference at byte 234, line 1 after "' .. xes .. 'X" vs "' .. xes .. 'Y"', v:errors[0])
+ call remove(v:errors, 0)
+
+ call assert_equal(1, assert_equalfile('Xone', 'Xtwo', 'a message'))
+ call assert_match("a message: difference at byte 234, line 1 after", v:errors[0])
call remove(v:errors, 0)
call delete('Xone')
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim
index 42e18ed027..49bbe84869 100644
--- a/src/nvim/testdir/test_diffmode.vim
+++ b/src/nvim/testdir/test_diffmode.vim
@@ -800,3 +800,25 @@ func Test_diff_closeoff()
diffoff!
enew!
endfunc
+
+func Test_diff_and_scroll()
+ " this was causing an ml_get error
+ set ls=2
+ for i in range(winheight(0) * 2)
+ call setline(i, i < winheight(0) - 10 ? i : i + 10)
+ endfor
+ vnew
+ for i in range(winheight(0)*2 + 10)
+ call setline(i, i < winheight(0) - 10 ? 0 : i)
+ endfor
+ diffthis
+ wincmd p
+ diffthis
+ execute 'normal ' . winheight(0) . "\<C-d>"
+
+ bwipe!
+ bwipe!
+ set ls&
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_registers.vim b/src/nvim/testdir/test_registers.vim
index d4f58af10a..d20f8d1eef 100644
--- a/src/nvim/testdir/test_registers.vim
+++ b/src/nvim/testdir/test_registers.vim
@@ -167,4 +167,22 @@ func Test_set_register()
enew!
endfunc
+func Test_ve_blockpaste()
+ new
+ set ve=all
+ 0put =['QWERTZ','ASDFGH']
+ call cursor(1,1)
+ exe ":norm! \<C-V>3ljdP"
+ call assert_equal(1, col('.'))
+ call assert_equal(getline(1, 2), ['QWERTZ', 'ASDFGH'])
+ call cursor(1,1)
+ exe ":norm! \<C-V>3ljd"
+ call cursor(1,1)
+ norm! $3lP
+ call assert_equal(5, col('.'))
+ call assert_equal(getline(1, 2), ['TZ QWER', 'GH ASDF'])
+ set ve&vim
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab