diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-07-12 10:44:39 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-07-19 11:40:34 -0400 |
| commit | bf882281800fe155536de487418d8052812446e5 (patch) | |
| tree | 63b3b42a59f12378b95e171866a786c06dd636f9 /src/nvim/testdir | |
| parent | 93f2dc0d034677a47c9ba7032b3537c91a718096 (diff) | |
| download | rneovim-bf882281800fe155536de487418d8052812446e5.tar.gz rneovim-bf882281800fe155536de487418d8052812446e5.tar.bz2 rneovim-bf882281800fe155536de487418d8052812446e5.zip | |
vim-patch:8.2.0899: assert_equalfile() does not give a hint about the difference
Problem: Assert_equalfile() does not give a hint about the difference.
Solution: Display the last seen text.
https://github.com/vim/vim/commit/30cc44a97f0ba1349e1a522dab22b11f47888183
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_assert.vim | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_assert.vim b/src/nvim/testdir/test_assert.vim index 86993e0acc..b4f7478807 100644 --- a/src/nvim/testdir/test_assert.vim +++ b/src/nvim/testdir/test_assert.vim @@ -28,11 +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 4", v:errors[0]) + call assert_match("a message: difference at byte 234, line 1 after", v:errors[0]) call remove(v:errors, 0) call delete('Xone') |