view src/testdir/test_feedkeys.vim @ 18144:95719bfeced2 v8.1.2067

patch 8.1.2067: no tests for SafeState and SafeStateAgain Commit: https://github.com/vim/vim/commit/cadbe1b1fbdf7d7740ae617710e0f6862fdee598 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 22 21:50:09 2019 +0200 patch 8.1.2067: no tests for SafeState and SafeStateAgain Problem: No tests for SafeState and SafeStateAgain. Solution: Add tests.
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Sep 2019 22:00:03 +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