diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-05-17 02:13:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-17 02:13:31 +0200 |
commit | 2aa308c6852b7c51caef5dd6dc4e809719ca7a55 (patch) | |
tree | a01a72b5ccd7bc00acb7db74397608a85a4aba95 /test/functional/normal/macro_spec.lua | |
parent | de7a0bdc35922d4f529bd4b28f992177152d4562 (diff) | |
parent | 9058a5a19a3f62fb156203e0226eaaabb8b8da56 (diff) | |
download | rneovim-2aa308c6852b7c51caef5dd6dc4e809719ca7a55.tar.gz rneovim-2aa308c6852b7c51caef5dd6dc4e809719ca7a55.tar.bz2 rneovim-2aa308c6852b7c51caef5dd6dc4e809719ca7a55.zip |
Merge #5658 'Apply :lmap in macros'
Diffstat (limited to 'test/functional/normal/macro_spec.lua')
-rw-r--r-- | test/functional/normal/macro_spec.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/normal/macro_spec.lua b/test/functional/normal/macro_spec.lua new file mode 100644 index 0000000000..102d8fc723 --- /dev/null +++ b/test/functional/normal/macro_spec.lua @@ -0,0 +1,30 @@ +local helpers = require('test.functional.helpers')(after_each) + +local eq = helpers.eq +local eval = helpers.eval +local feed = helpers.feed +local clear = helpers.clear +local expect = helpers.expect +local command = helpers.command + +describe('macros', function() + before_each(clear) + it('can be recorded and replayed', function() + feed('qiahello<esc>q') + expect('hello') + eq(eval('@i'), 'ahello') + feed('@i') + expect('hellohello') + eq(eval('@i'), 'ahello') + end) + it('applies maps', function() + command('imap x l') + command('nmap l a') + feed('qilxxx<esc>q') + expect('lll') + eq(eval('@i'), 'lxxx') + feed('@i') + expect('llllll') + eq(eval('@i'), 'lxxx') + end) +end) |