comparison src/testdir/test_expr_utf8.vim @ 24132:512f48dc7100 v8.2.2607

patch 8.2.2607: strcharpart() cannot include composing characters Commit: https://github.com/vim/vim/commit/02b4d9b18a03549b68e364e428392b7a62766c74 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 14 19:46:45 2021 +0100 patch 8.2.2607: strcharpart() cannot include composing characters Problem: strcharpart() cannot include composing characters. Solution: Add the {skipcc} argument.
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 Mar 2021 20:00:02 +0100
parents 08940efa6b4e
children
comparison
equal deleted inserted replaced
24131:81f596485c08 24132:512f48dc7100
29 call assert_equal('あ', strcharpart('あいうeお', -3, 4)) 29 call assert_equal('あ', strcharpart('あいうeお', -3, 4))
30 30
31 call assert_equal('a', strcharpart('àxb', 0, 1)) 31 call assert_equal('a', strcharpart('àxb', 0, 1))
32 call assert_equal('̀', strcharpart('àxb', 1, 1)) 32 call assert_equal('̀', strcharpart('àxb', 1, 1))
33 call assert_equal('x', strcharpart('àxb', 2, 1)) 33 call assert_equal('x', strcharpart('àxb', 2, 1))
34
35
36 call assert_equal('a', strcharpart('àxb', 0, 1, 0))
37 call assert_equal('à', strcharpart('àxb', 0, 1, 1))
38 call assert_equal('x', strcharpart('àxb', 1, 1, 1))
39
40 call assert_fails("let v = strcharpart('abc', 0, 0, [])", 'E745:')
41 call assert_fails("let v = strcharpart('abc', 0, 0, 2)", 'E1023:')
34 endfunc 42 endfunc
35 43
36 " vim: shiftwidth=2 sts=2 expandtab 44 " vim: shiftwidth=2 sts=2 expandtab