aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-02-09 01:41:04 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-02-09 01:41:04 -0500
commit17ae27190d4589b2a35f44bc6c8b552f4bf06d4e (patch)
tree63744d41c9c2e3b0fe0eafd55e96d26896bbba82 /test
parent31aa060bca0084d19eac382408727c5f3b190af3 (diff)
parent18be6e0b30e64b45d3bcec944ac19a32410da0ee (diff)
downloadrneovim-17ae27190d4589b2a35f44bc6c8b552f4bf06d4e.tar.gz
rneovim-17ae27190d4589b2a35f44bc6c8b552f4bf06d4e.tar.bz2
rneovim-17ae27190d4589b2a35f44bc6c8b552f4bf06d4e.zip
Merge #4136 vim-patch:7.4.{755,758,760}
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/utf8_spec.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/legacy/utf8_spec.lua b/test/functional/legacy/utf8_spec.lua
index ef717042d0..c16b1c45f4 100644
--- a/test/functional/legacy/utf8_spec.lua
+++ b/test/functional/legacy/utf8_spec.lua
@@ -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)