aboutsummaryrefslogtreecommitdiff
path: root/test/functional/normal/macro_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-05-17 02:13:31 +0200
committerGitHub <noreply@github.com>2018-05-17 02:13:31 +0200
commit2aa308c6852b7c51caef5dd6dc4e809719ca7a55 (patch)
treea01a72b5ccd7bc00acb7db74397608a85a4aba95 /test/functional/normal/macro_spec.lua
parentde7a0bdc35922d4f529bd4b28f992177152d4562 (diff)
parent9058a5a19a3f62fb156203e0226eaaabb8b8da56 (diff)
downloadrneovim-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.lua30
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)