neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

test_ex_equal.vim (788B)


      1 " Test Ex := command.
      2 
      3 func Test_ex_equal()
      4  new
      5  call setline(1, ["foo\tbar", "bar\tfoo"])
      6 
      7  let a = execute('=')
      8  call assert_equal("\n2", a)
      9 
     10  let a = execute('.=')
     11  call assert_equal("\n1", a)
     12 
     13  call assert_fails('3=', 'E16:')
     14  bwipe!
     15 endfunc
     16 
     17 func Test_ex_equal_arg()
     18  throw 'skipped: Nvim evaluates lua with := [arg]'
     19 
     20  new
     21  call setline(1, ["foo\tbar", "bar\tfoo"])
     22 
     23  let a = execute('=#')
     24  call assert_equal("\n2\n  1 foo     bar", a)
     25 
     26  let a = execute('=l')
     27  call assert_equal("\n2\nfoo^Ibar$", a)
     28 
     29  let a = execute('=p')
     30  call assert_equal("\n2\nfoo     bar", a)
     31 
     32  let a = execute('=l#')
     33  call assert_equal("\n2\n  1 foo^Ibar$", a)
     34 
     35  let a = execute('=p#')
     36  call assert_equal("\n2\n  1 foo     bar", a)
     37 
     38  call assert_fails('=x', 'E488:')
     39 
     40  bwipe!
     41 endfunc