diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-04 16:52:40 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-04 16:52:40 +0200 |
commit | 30cc44a97f0ba1349e1a522dab22b11f47888183 (patch) | |
tree | 6d8731ca73501ec931eb83708dc9032a97220797 /src/testdir/test_assert.vim | |
parent | 6b0e528368415476bfc3a8414c9c70f9852b1517 (diff) | |
download | vim-git-30cc44a97f0ba1349e1a522dab22b11f47888183.tar.gz |
patch 8.2.0899: assert_equalfile() does not give a hint about the differencev8.2.0899
Problem: Assert_equalfile() does not give a hint about the difference.
Solution: Display the last seen text.
Diffstat (limited to 'src/testdir/test_assert.vim')
-rw-r--r-- | src/testdir/test_assert.vim | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim index 5037d87b8..2147e3de4 100644 --- a/src/testdir/test_assert.vim +++ b/src/testdir/test_assert.vim @@ -78,11 +78,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') |