]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1779: Need more state() tests v9.0.1779
authorzeertzjq <zeertzjq@outlook.com>
Tue, 22 Aug 2023 19:22:24 +0000 (21:22 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 22 Aug 2023 19:22:24 +0000 (21:22 +0200)
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
src/testdir/test_functions.vim
src/version.c

index a500b734b276f5b1eb596024f711d3cb16043da6..0eda5de380e9d087538e40495b6b27e33add6a15 100644 (file)
@@ -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)
index 50e2187c4c91641b5a110a5fd61b7a38a6d24a57..3ca3167cb9fcc29ac636313dcf2733d0fdbc2416 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1779,
 /**/
     1778,
 /**/