view src/testdir/test_behave.vim @ 19930:80e663e91e1b v8.2.0521

patch 8.2.0521: crash when reading a blob fails Commit: https://github.com/vim/vim/commit/15352dc6ec43fd50cc3be4f4fd1ad74d5619da20 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 6 21:12:42 2020 +0200 patch 8.2.0521: crash when reading a blob fails Problem: Crash when reading a blob fails. Solution: Avoid keeping a pointer to a freed blob object. (Dominique Pelle, closes #5890) Adjust error messages.
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Apr 2020 21:15:37 +0200
parents d4db9adc8642
children 08940efa6b4e
line wrap: on
line source

" Test the :behave command

func Test_behave()
  behave mswin
  call assert_equal('mouse,key', &selectmode)
  call assert_equal('popup', &mousemodel)
  call assert_equal('startsel,stopsel', &keymodel)
  call assert_equal('exclusive', &selection)

  behave xterm
  call assert_equal('', &selectmode)
  call assert_equal('extend', &mousemodel)
  call assert_equal('', &keymodel)
  call assert_equal('inclusive', &selection)

  set selection&
  set mousemodel&
  set keymodel&
  set selection&
endfunc

func Test_behave_completion()
  call feedkeys(":behave \<C-A>\<C-B>\"\<CR>", 'tx')
  call assert_equal('"behave mswin xterm', @:)
endfunc

func Test_behave_error()
  call assert_fails('behave x', 'E475:')
endfunc