view src/testdir/test_feedkeys.vim @ 26406:fcc57227e99b v8.2.3734

patch 8.2.3734: Vim9: crash when no pattern match found Commit: https://github.com/vim/vim/commit/01a4dcbceefa99696bd1ef8631c3f7ce9f6e0cc2 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 4 13:15:10 2021 +0000 patch 8.2.3734: Vim9: crash when no pattern match found Problem: Vim9: crash when no pattern match found. Solution: Check for error.
author Bram Moolenaar <Bram@vim.org>
date Sat, 04 Dec 2021 14:30:03 +0100
parents 08940efa6b4e
children e06cbcf4b94b
line wrap: on
line source

" Test feedkeys() function.

func Test_feedkeys_x_with_empty_string()
  new
  call feedkeys("ifoo\<Esc>")
  call assert_equal('', getline('.'))
  call feedkeys('', 'x')
  call assert_equal('foo', getline('.'))

  " check it goes back to normal mode immediately.
  call feedkeys('i', 'x')
  call assert_equal('foo', getline('.'))
  quit!
endfunc

" vim: shiftwidth=2 sts=2 expandtab