view src/testdir/test_feedkeys.vim @ 20901:7d0fe945278c v8.2.1002

patch 8.2.1002: test may fail when run directly Commit: https://github.com/vim/vim/commit/ceb2e7751089bd417c6250d63e28616483b5796b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 18 18:33:59 2020 +0200 patch 8.2.1002: test may fail when run directly Problem: Test may fail when run directly. Solution: Check if g:run_nr exists. (Christian Brabandt, closes https://github.com/vim/vim/issues/6285)
author Bram Moolenaar <Bram@vim.org>
date Thu, 18 Jun 2020 18:45:04 +0200
parents 6b70b9cdebfc
children 08940efa6b4e
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