aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-06-08 02:07:31 -0400
committerJustin M. Keyes <justinkz@gmail.com>2018-06-08 08:07:31 +0200
commit4871f26c220c5cedbe2f4fbf6cb379da91aef0c3 (patch)
treeb279a226146553dfbc3864639a4ac7f88bef7c0f /src
parentbd736a98e38450b8d69bb3087035436372cf4f1b (diff)
downloadrneovim-4871f26c220c5cedbe2f4fbf6cb379da91aef0c3.tar.gz
rneovim-4871f26c220c5cedbe2f4fbf6cb379da91aef0c3.tar.bz2
rneovim-4871f26c220c5cedbe2f4fbf6cb379da91aef0c3.zip
vim-patch:8.0.0586: no test for mapping timing out (#8501)
Problem: No test for mapping timing out. Solution: Add a test. https://github.com/vim/vim/commit/b7637c44c26b057d1f3721d932bbab06d9f74393
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_mapping.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim
index f5e4c4b90c..0a198763bb 100644
--- a/src/nvim/testdir/test_mapping.vim
+++ b/src/nvim/testdir/test_mapping.vim
@@ -160,3 +160,30 @@ func Test_map_meta_quotes()
set nomodified
iunmap <M-">
endfunc
+
+func Test_map_timeout()
+ nnoremap aaaa :let got_aaaa = 1<CR>
+ nnoremap bb :let got_bb = 1<CR>
+ nmap b aaa
+ new
+ func ExitInsert(timer)
+ let g:line = getline(1)
+ call feedkeys("\<Esc>", "t")
+ endfunc
+ set timeout timeoutlen=200
+ call timer_start(300, 'ExitInsert')
+ " After the 'b' Vim waits for another character to see if it matches 'bb'.
+ " When it times out it is expanded to "aaa", but there is no wait for
+ " "aaaa". Can't check that reliably though.
+ call feedkeys("b", "xt!")
+ call assert_equal("aa", g:line)
+ call assert_false(exists('got_aaa'))
+ call assert_false(exists('got_bb'))
+
+ bwipe!
+ nunmap aaaa
+ nunmap bb
+ nunmap b
+ set timeoutlen&
+ delfunc ExitInsert
+endfunc