view src/testdir/test_ex_equal.vim @ 28570:35e24d9de858 v8.2.4809

patch 8.2.4809: various things no6 properly tested Commit: https://github.com/vim/vim/commit/885de449c0c0ef4a8541ed1f5377351844384516 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sat Apr 23 10:51:14 2022 +0100 patch 8.2.4809: various things no6 properly tested Problem: Various things no6 properly tested. Solution: Add various test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/10259)
author Bram Moolenaar <Bram@vim.org>
date Sat, 23 Apr 2022 12:00:06 +0200
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