robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

bfredlMerge pull request #22743 from bfredl/luaequalsc45b5e2c5b

master
788 B41 linesraw
1" Test Ex := command.
2
3func 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!
15endfunc
16
17func 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!
41endfunc