changeset 32958:578ffda95ad5 v9.0.1779

patch 9.0.1779: Need more state() tests Commit: https://github.com/vim/vim/commit/8dabccd295271104ad5af0abc48e283d644cff59 Author: zeertzjq <zeertzjq@outlook.com> Date: Tue Aug 22 21:22:24 2023 +0200 patch 9.0.1779: Need more state() tests 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
author Christian Brabandt <cb@256bit.org>
date Tue, 22 Aug 2023 21:30:03 +0200
parents a5bd10de6c37
children a0266fbc89f5
files src/testdir/test_functions.vim src/version.c
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1779,
+/**/
     1778,
 /**/
     1777,