aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-10 06:35:51 +0800
committerGitHub <noreply@github.com>2024-08-10 06:35:51 +0800
commit4e8efe002e976de1a22dcce6a1e800aeb6acad70 (patch)
tree734bbdbd7a1ac6413818609a892615694770bb3a /test
parent0d3f2c4904d552635da07a6e2b4e75520b514940 (diff)
downloadrneovim-4e8efe002e976de1a22dcce6a1e800aeb6acad70.tar.gz
rneovim-4e8efe002e976de1a22dcce6a1e800aeb6acad70.tar.bz2
rneovim-4e8efe002e976de1a22dcce6a1e800aeb6acad70.zip
vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly (#30018)
Problem: assert_equal() doesn't show multibyte string correctly Solution: Properly advance over a multibyte char. (zeertzjq) closes: vim/vim#15456 https://github.com/vim/vim/commit/9c4b2462bb498f44044616f7309d111d12170369
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_assert.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/old/testdir/test_assert.vim b/test/old/testdir/test_assert.vim
index bc79ef9296..fa63af687d 100644
--- a/test/old/testdir/test_assert.vim
+++ b/test/old/testdir/test_assert.vim
@@ -48,10 +48,19 @@ func Test_assert_equal()
call assert_match("Expected 'bar' but got 'foo'", v:errors[0])
call remove(v:errors, 0)
+ let s = 'αβγ'
+ call assert_equal(1, assert_equal('δεζ', s))
+ call assert_match("Expected 'δεζ' but got 'αβγ'", v:errors[0])
+ call remove(v:errors, 0)
+
call assert_equal('XxxxxxxxxxxxxxxxxxxxxxX', 'XyyyyyyyyyyyyyyyyyyyyyyyyyX')
call assert_match("Expected 'X\\\\\\[x occurs 21 times]X' but got 'X\\\\\\[y occurs 25 times]X'", v:errors[0])
call remove(v:errors, 0)
+ call assert_equal('ΩωωωωωωωωωωωωωωωωωωωωωΩ', 'ΩψψψψψψψψψψψψψψψψψψψψψψψψψΩ')
+ call assert_match("Expected 'Ω\\\\\\[ω occurs 21 times]Ω' but got 'Ω\\\\\\[ψ occurs 25 times]Ω'", v:errors[0])
+ call remove(v:errors, 0)
+
" special characters are escaped
call assert_equal("\b\e\f\n\t\r\\\x01\x7f", 'x')
call assert_match('Expected ''\\b\\e\\f\\n\\t\\r\\\\\\x01\\x7f'' but got ''x''', v:errors[0])