diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-12-27 22:49:44 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-12-27 22:49:44 +0100 |
commit | c1015121ec626cab6cb384f544bc0be1a1760c0e (patch) | |
tree | 6cc9a5d1899a4486a24c491e07d17a7dd01f9503 /test/unit | |
parent | 4f030ec24e0e148bbb83aedaef7dd629e5fef130 (diff) | |
parent | e1876c7ad1b5e30c0a9919e2c4587d11550c8507 (diff) | |
download | rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.gz rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.bz2 rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.zip |
Merge 'upstream/master' into pr-win-erw7
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/mbyte_spec.lua | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/unit/mbyte_spec.lua b/test/unit/mbyte_spec.lua index 1e7e9fd6e6..3e65537270 100644 --- a/test/unit/mbyte_spec.lua +++ b/test/unit/mbyte_spec.lua @@ -43,15 +43,17 @@ describe('mbyte', function() -- Sequences with more than four bytes end) - itp('utf_char2bytes', function() - local char_p = ffi.typeof('char[?]') - for c = 0, 0xFFFF do - local p = char_p(4, 0) - mbyte.utf_char2bytes(c, p) - eq(c, mbyte.utf_ptr2char(p)) - eq(charset.vim_iswordc(c), charset.vim_iswordp(p)) - end - end) + for n = 0, 0xF do + itp(('utf_char2bytes for chars 0x%x - 0x%x'):format(n * 0x1000, n * 0x1000 + 0xFFF), function() + local char_p = ffi.typeof('char[?]') + for c = n * 0x1000, n * 0x1000 + 0xFFF do + local p = char_p(4, 0) + mbyte.utf_char2bytes(c, p) + eq(c, mbyte.utf_ptr2char(p)) + eq(charset.vim_iswordc(c), charset.vim_iswordp(p)) + end + end) + end describe('utfc_ptr2char_len', function() |