diff options
author | Josh Rahm <rahm@google.com> | 2022-10-11 19:00:52 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-10-11 19:00:52 +0000 |
commit | 21e2e46242033c7aaa6ccfb23e256680816c063c (patch) | |
tree | f089522cfb145d6e9c8a86a01d8e454ce5501e20 /test/functional/legacy/match_spec.lua | |
parent | 179d3ed87b17988f5fe00d8b99f2611a28212be7 (diff) | |
parent | 760b399f6c0c6470daa0663752bd22886997f9e6 (diff) | |
download | rneovim-floattitle.tar.gz rneovim-floattitle.tar.bz2 rneovim-floattitle.zip |
Merge remote-tracking branch 'upstream/master' into floattitlefloattitle
Diffstat (limited to 'test/functional/legacy/match_spec.lua')
-rw-r--r-- | test/functional/legacy/match_spec.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/legacy/match_spec.lua b/test/functional/legacy/match_spec.lua new file mode 100644 index 0000000000..271f844f9d --- /dev/null +++ b/test/functional/legacy/match_spec.lua @@ -0,0 +1,38 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear = helpers.clear +local exec = helpers.exec + +before_each(clear) + +describe('matchaddpos()', function() + -- oldtest: Test_matchaddpos_dump() + it('can add more than 8 match positions vim-patch:9.0.0620', function() + local screen = Screen.new(60, 14) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {background = Screen.colors.Yellow}, -- Search + }) + screen:attach() + exec([[ + call setline(1, ['1234567890123']->repeat(14)) + call matchaddpos('Search', range(1, 12)->map({i, v -> [v, v]})) + ]]) + screen:expect([[ + {1:^1}234567890123 | + 1{1:2}34567890123 | + 12{1:3}4567890123 | + 123{1:4}567890123 | + 1234{1:5}67890123 | + 12345{1:6}7890123 | + 123456{1:7}890123 | + 1234567{1:8}90123 | + 12345678{1:9}0123 | + 123456789{1:0}123 | + 1234567890{1:1}23 | + 12345678901{1:2}3 | + 1234567890123 | + | + ]]) + end) +end) |