comparison src/testdir/test_assert.vim @ 27742:3b2c75c0a7ab v8.2.4397

patch 8.2.4397: crash when using many composing characters in error message Commit: https://github.com/vim/vim/commit/34f8117dec685ace52cd9e578e2729db278163fc Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 16 12:16:19 2022 +0000 patch 8.2.4397: crash when using many composing characters in error message Problem: Crash when using many composing characters in error message. Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
author Bram Moolenaar <Bram@vim.org>
date Wed, 16 Feb 2022 13:30:05 +0100
parents e8e2c4d33b9b
children 567b5a2a1884
comparison
equal deleted inserted replaced
27741:c3d762e7b5ce 27742:3b2c75c0a7ab
51 51
52 " special characters are escaped 52 " special characters are escaped
53 call assert_equal("\b\e\f\n\t\r\\\x01\x7f", 'x') 53 call assert_equal("\b\e\f\n\t\r\\\x01\x7f", 'x')
54 call assert_match('Expected ''\\b\\e\\f\\n\\t\\r\\\\\\x01\\x7f'' but got ''x''', v:errors[0]) 54 call assert_match('Expected ''\\b\\e\\f\\n\\t\\r\\\\\\x01\\x7f'' but got ''x''', v:errors[0])
55 call remove(v:errors, 0) 55 call remove(v:errors, 0)
56
57 " many composing characters are handled properly
58 call setline(1, ' ')
59 norm 100grƯ€
60 call assert_equal(1, getline(1))
61 call assert_match("Expected 1 but got '.* occurs 100 times]'", v:errors[0])
62 call remove(v:errors, 0)
63 bwipe!
56 endfunc 64 endfunc
57 65
58 func Test_assert_equal_dict() 66 func Test_assert_equal_dict()
59 call assert_equal(0, assert_equal(#{one: 1, two: 2}, #{two: 2, one: 1})) 67 call assert_equal(0, assert_equal(#{one: 1, two: 2}, #{two: 2, one: 1}))
60 68