view src/testdir/test_feedkeys.vim @ 26250:3711e56f7e7b v8.2.3656

patch 8.2.3656: Vim9: no error for an evironment variable by itself Commit: https://github.com/vim/vim/commit/65259b5c6a8ad4edaf6eeb8dbb7b50342c64d403 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 23 14:52:06 2021 +0000 patch 8.2.3656: Vim9: no error for an evironment variable by itself Problem: Vim9: no error for an evironment variable by itself. Solution: Give a "without effect" error. (closes https://github.com/vim/vim/issues/9166)
author Bram Moolenaar <Bram@vim.org>
date Tue, 23 Nov 2021 16:00:06 +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