view src/testdir/test_ex_equal.vim @ 23254:4b7e996354e0 v8.2.2173

patch 8.2.2173: Vim9: get internal error when assigning to undefined variable Commit: https://github.com/vim/vim/commit/52c124d3303d3cc3e4504708881906d17d6d6c55 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 20 21:43:35 2020 +0100 patch 8.2.2173: Vim9: get internal error when assigning to undefined variable Problem: Vim9: get internal error when assigning to undefined variable. Solution: Add error message. (closes https://github.com/vim/vim/issues/7475)
author Bram Moolenaar <Bram@vim.org>
date Sun, 20 Dec 2020 21:45:04 +0100
parents 08940efa6b4e
children
line wrap: on
line source

" Test Ex := command.

func Test_ex_equal()
  new
  call setline(1, ["foo\tbar", "bar\tfoo"])

  let a = execute('=')
  call assert_equal("\n2", a)

  let a = execute('=#')
  call assert_equal("\n2\n  1 foo     bar", a)

  let a = execute('=l')
  call assert_equal("\n2\nfoo^Ibar$", a)

  let a = execute('=p')
  call assert_equal("\n2\nfoo     bar", a)

  let a = execute('=l#')
  call assert_equal("\n2\n  1 foo^Ibar$", a)

  let a = execute('=p#')
  call assert_equal("\n2\n  1 foo     bar", a)

  let a = execute('.=')
  call assert_equal("\n1", a)

  call assert_fails('3=', 'E16:')
  call assert_fails('=x', 'E488:')

  bwipe!
endfunc

" vim: shiftwidth=2 sts=2 expandtab