vim-patch:8.1.0819: a failed assert with a long string is hard to read

Problem:    A failed assert with a long string is hard to read.
Solution:   Shorten the assert message.
865767126e
This commit is contained in:
Jan Edmund Lazo
2020-07-12 07:40:55 -04:00
parent 65793a90d7
commit ab69ea26dc
2 changed files with 51 additions and 12 deletions

View File

@@ -92,6 +92,11 @@ describe('assert function:', function()
call('assert_equal', 'foo', 'bar', 'testing')
expected_errors({"testing: Expected 'foo' but got 'bar'"})
end)
it('should shorten a long message', function()
call ('assert_equal', 'XxxxxxxxxxxxxxxxxxxxxxX', 'XyyyyyyyyyyyyyyyyyyyyyyyyyX')
expected_errors({"Expected 'X\\[x occurs 21 times]X' but got 'X\\[y occurs 25 times]X'"})
end)
end)
-- assert_notequal({expected}, {actual}[, {msg}])