view src/testdir/test_feedkeys.vim @ 21709:16d6b626aa8f v8.2.1404

patch 8.2.1404: Vim9: script test fails in the GUI Commit: https://github.com/vim/vim/commit/b3ca98240761d8f320c5a49e077d1aac6496bb21 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 9 14:43:58 2020 +0200 patch 8.2.1404: Vim9: script test fails in the GUI Problem: Vim9: script test fails in the GUI. Solution: Use another key to map. Improve cleanup.
author Bram Moolenaar <Bram@vim.org>
date Sun, 09 Aug 2020 14: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