diff options
author | ZyX <kp-pav@yandex.ru> | 2016-08-20 22:24:34 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:07:42 +0300 |
commit | e18a5783080f7c94f408ec5f53dedffdb69789e1 (patch) | |
tree | 17f54dfabb1163f2defce7989b3a182b846334f9 /test/functional/eval/match_functions_spec.lua | |
parent | 50a48f2a0ecf7f767df961f7f5060505cf28e331 (diff) | |
download | rneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.tar.gz rneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.tar.bz2 rneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.zip |
*: Move some dictionary functions to typval.h and use char*
Also fixes buffer reusage in setmatches() and complete().
Diffstat (limited to 'test/functional/eval/match_functions_spec.lua')
-rw-r--r-- | test/functional/eval/match_functions_spec.lua | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/functional/eval/match_functions_spec.lua b/test/functional/eval/match_functions_spec.lua new file mode 100644 index 0000000000..df91e41475 --- /dev/null +++ b/test/functional/eval/match_functions_spec.lua @@ -0,0 +1,39 @@ +local helpers = require('test.functional.helpers')(after_each) + +local eq = helpers.eq +local clear = helpers.clear +local funcs = helpers.funcs +local command = helpers.command + +before_each(clear) + +describe('setmatches()', function() + it('correctly handles case when both group and pattern entries are numbers', + function() + command('hi def link 1 PreProc') + eq(0, funcs.setmatches({{group=1, pattern=2, id=3, priority=4}})) + eq({{ + group='1', + pattern='2', + id=3, + priority=4, + }}, funcs.getmatches()) + eq(0, funcs.setmatches({{group=1, pattern=2, id=3, priority=4, conceal=5}})) + eq({{ + group='1', + pattern='2', + id=3, + priority=4, + conceal='5', + }}, funcs.getmatches()) + eq(0, funcs.setmatches({{group=1, pos1={2}, pos2={6}, id=3, priority=4, conceal=5}})) + eq({{ + group='1', + pos1={2}, + pos2={6}, + id=3, + priority=4, + conceal='5', + }}, funcs.getmatches()) + end) +end) |