summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-22 21:22:24 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-22 21:22:24 +0200
commit8dabccd295271104ad5af0abc48e283d644cff59 (patch)
tree7fc015e2d7875279ac3188b3533d6100955d5cf0 /src/testdir
parenta76f3221cdcfff6880213839de4d04cf0c7c60f8 (diff)
patch 9.0.1779: Need more state() testsv9.0.1779
Problem: Need more state() tests Solution: Add a few more tests for operater pending mode and register yank command closes: #12883 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: author
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_functions.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index a500b734b2..0eda5de380 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -2901,6 +2901,20 @@ func Test_state()
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: mSc; mode: n', term_getline(buf, 6))}, 1000)
+ " A operator is pending
+ call term_sendkeys(buf, ":call RunTimer()\<CR>y")
+ call TermWait(buf, 25)
+ call term_sendkeys(buf, "y")
+ call term_sendkeys(buf, getstate)
+ call WaitForAssert({-> assert_match('state: oSc; mode: n', term_getline(buf, 6))}, 1000)
+
+ " A register was specified
+ call term_sendkeys(buf, ":call RunTimer()\<CR>\"r")
+ call TermWait(buf, 25)
+ call term_sendkeys(buf, "yy")
+ call term_sendkeys(buf, getstate)
+ call WaitForAssert({-> assert_match('state: oSc; mode: n', term_getline(buf, 6))}, 1000)
+
" Insert mode completion (bit slower on Mac)
call term_sendkeys(buf, ":call RunTimer()\<CR>Got\<C-N>")
call TermWait(buf, 25)