mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
vim-patch:7.4.755
Problem: It is not easy to count the number of characters.
Solution: Add the skipcc argument to strchars(). (Hirohito Higashi, Ken
Takata)
641e48c224
This commit is contained in:
committed by
Justin M. Keyes
parent
31aa060bca
commit
a9a25fda42
@@ -3,6 +3,7 @@
|
||||
local helpers = require('test.functional.helpers')
|
||||
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
||||
local execute, expect = helpers.execute, helpers.expect
|
||||
local eq, eval = helpers.eq, helpers.eval
|
||||
|
||||
describe('utf8', function()
|
||||
setup(clear)
|
||||
@@ -27,4 +28,26 @@ describe('utf8', function()
|
||||
xあああ
|
||||
bxbb]])
|
||||
end)
|
||||
|
||||
it('strchars()', function()
|
||||
eq(1, eval('strchars("a")'))
|
||||
eq(1, eval('strchars("a", 0)'))
|
||||
eq(1, eval('strchars("a", 1)'))
|
||||
|
||||
eq(3, eval('strchars("あいa")'))
|
||||
eq(3, eval('strchars("あいa", 0)'))
|
||||
eq(3, eval('strchars("あいa", 1)'))
|
||||
|
||||
eq(2, eval('strchars("A\\u20dd")'))
|
||||
eq(2, eval('strchars("A\\u20dd", 0)'))
|
||||
eq(1, eval('strchars("A\\u20dd", 1)'))
|
||||
|
||||
eq(3, eval('strchars("A\\u20dd\\u20dd")'))
|
||||
eq(3, eval('strchars("A\\u20dd\\u20dd", 0)'))
|
||||
eq(1, eval('strchars("A\\u20dd\\u20dd", 1)'))
|
||||
|
||||
eq(1, eval('strchars("\\u20dd")'))
|
||||
eq(1, eval('strchars("\\u20dd", 0)'))
|
||||
eq(1, eval('strchars("\\u20dd", 1)'))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user