view src/testdir/test_behave.vim @ 24357:108a6e2497f6 v8.2.2719

patch 8.2.2719: Vim9: appending to dict item doesn't work in a :def function Commit: https://github.com/vim/vim/commit/e42939af87be3adad8c08ceb454e3a31114d7165 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 5 17:11:17 2021 +0200 patch 8.2.2719: Vim9: appending to dict item doesn't work in a :def function Problem: Vim9: appending to dict item doesn't work in a :def function. Solution: Implement assignment with operator on indexed item.
author Bram Moolenaar <Bram@vim.org>
date Mon, 05 Apr 2021 17:15:06 +0200
parents 08940efa6b4e
children
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

" vim: shiftwidth=2 sts=2 expandtab