diff src/testdir/test_functions.vim @ 21973:85add08e6a2d v8.2.1536

patch 8.2.1536: cannot get the class of a character; emoji widths are wrong Commit: https://github.com/vim/vim/commit/4e4473c927167fd24e5c8df90e0e8035080cf2da Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 28 22:24:57 2020 +0200 patch 8.2.1536: cannot get the class of a character; emoji widths are wrong Problem: Cannot get the class of a character; emoji widths are wrong in some environments. Solution: Add charclass(). Update some emoji widths. Add script to check emoji widths.
author Bram Moolenaar <Bram@vim.org>
date Fri, 28 Aug 2020 22:30:04 +0200
parents 62f933f64447
children c67a9d3b3683
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -2077,6 +2077,13 @@ func Test_char2nr()
   set encoding=utf-8
 endfunc
 
+func Test_charclass()
+  call assert_equal(0, charclass(' '))
+  call assert_equal(1, charclass('.'))
+  call assert_equal(2, charclass('x'))
+  call assert_equal(3, charclass("\u203c"))
+endfunc
+
 func Test_eventhandler()
   call assert_equal(0, eventhandler())
 endfunc