aboutsummaryrefslogtreecommitdiff
path: root/test/unit/mbyte_spec.lua
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2018-11-15 07:06:37 -0500
committerJames McCoy <jamessan@jamessan.com>2018-11-15 07:06:37 -0500
commitc344f4b6aea7c985fee211a4263935362579d716 (patch)
treefeca71dfa3b24cb787dfb3e7bcb75eb3072a5cb9 /test/unit/mbyte_spec.lua
parentcd94dd6bb29f3140cb25b30e98fba9123bfd408f (diff)
downloadrneovim-c344f4b6aea7c985fee211a4263935362579d716.tar.gz
rneovim-c344f4b6aea7c985fee211a4263935362579d716.tar.bz2
rneovim-c344f4b6aea7c985fee211a4263935362579d716.zip
unit/mbyte_spec: Run utf_char2bytes test in batches of 0xFFF characters
Running the full 0xFFFF set of tests in one process fails on slower architectures/when there's CPU contention.
Diffstat (limited to 'test/unit/mbyte_spec.lua')
-rw-r--r--test/unit/mbyte_spec.lua20
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()