diff 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
line wrap: on
line diff
--- a/src/testdir/test_expr_utf8.vim
+++ b/src/testdir/test_expr_utf8.vim
@@ -31,6 +31,14 @@ func Test_strcharpart()
   call assert_equal('a', strcharpart('àxb', 0, 1))
   call assert_equal('̀', strcharpart('àxb', 1, 1))
   call assert_equal('x', strcharpart('àxb', 2, 1))
+
+
+  call assert_equal('a', strcharpart('àxb', 0, 1, 0))
+  call assert_equal('à', strcharpart('àxb', 0, 1, 1))
+  call assert_equal('x', strcharpart('àxb', 1, 1, 1))
+
+  call assert_fails("let v = strcharpart('abc', 0, 0, [])", 'E745:')
+  call assert_fails("let v = strcharpart('abc', 0, 0, 2)", 'E1023:')
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab