diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-02-05 10:02:38 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-02-05 10:02:38 -0500 |
commit | d9cada146fbb476fc2239cc2235deeff2ab8c1dd (patch) | |
tree | a2fe043d0937d19813de67866cb547591267c65c /test/functional/legacy/textobjects_spec.lua | |
parent | 7b955802b3c5ca32467b58e09786e40d167fd3aa (diff) | |
parent | 4cbe52b3a3651047f51bd30801d8d9c26e0fce13 (diff) | |
download | rneovim-d9cada146fbb476fc2239cc2235deeff2ab8c1dd.tar.gz rneovim-d9cada146fbb476fc2239cc2235deeff2ab8c1dd.tar.bz2 rneovim-d9cada146fbb476fc2239cc2235deeff2ab8c1dd.zip |
Merge pull request #4157 from watiko/vim-7.4.694
vim-patch:7.4.{662,694}
Diffstat (limited to 'test/functional/legacy/textobjects_spec.lua')
-rw-r--r-- | test/functional/legacy/textobjects_spec.lua | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/functional/legacy/textobjects_spec.lua b/test/functional/legacy/textobjects_spec.lua new file mode 100644 index 0000000000..1e8e0b0bcb --- /dev/null +++ b/test/functional/legacy/textobjects_spec.lua @@ -0,0 +1,61 @@ +local helpers = require('test.functional.helpers') +local call = helpers.call +local clear = helpers.clear +local execute = helpers.execute +local expect = helpers.expect +local source = helpers.source + +describe('Text object', function() + before_each(function() + clear() + execute('set shada=') + source([[ + function SelectionOut(data) + new + call setline(1, a:data) + call setreg('"', '') + normal! ggfrmavi)y + $put =getreg('\"') + call setreg('"', '') + normal! `afbmavi)y + $put =getreg('\"') + call setreg('"', '') + normal! `afgmavi)y + $put =getreg('\"') + endfunction + ]]) + end) + + it('Test for vi) without cpo-M', function() + execute('set cpo-=M') + call('SelectionOut', '(red \\(blue) green)') + + expect([[ + (red \(blue) green) + red \(blue + red \(blue + ]]) + end) + + it('Test for vi) with cpo-M #1', function() + execute('set cpo+=M') + call('SelectionOut', '(red \\(blue) green)') + + expect([[ + (red \(blue) green) + red \(blue) green + blue + red \(blue) green]]) + end) + + it('Test for vi) with cpo-M #2', function() + execute('set cpo+=M') + call('SelectionOut', '(red (blue\\) green)') + + expect([[ + (red (blue\) green) + red (blue\) green + blue\ + red (blue\) green]]) + end) +end) |