comparison src/testdir/test_statusline.vim @ 29434:5da38c4ffe92 v9.0.0059

patch 9.0.0059: test file has wrong name Commit: https://github.com/vim/vim/commit/bb404f5ad5ec909318bc24e5b82e4ed7b87ba8f4 Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Jul 23 06:25:29 2022 +0100 patch 9.0.0059: test file has wrong name Problem: Test file has wrong name. Solution: Rename the file. Various small fixes. (closes https://github.com/vim/vim/issues/10674)
author Bram Moolenaar <Bram@vim.org>
date Sat, 23 Jul 2022 07:30:04 +0200
parents bd5b6ac5998f
children ae10b91ac6b3
comparison
equal deleted inserted replaced
29433:7f047c9af319 29434:5da38c4ffe92
4 " %N 4 " %N
5 5
6 source view_util.vim 6 source view_util.vim
7 source check.vim 7 source check.vim
8 source screendump.vim 8 source screendump.vim
9
10 func SetUp()
11 set laststatus=2
12 endfunc
13
14 func TearDown()
15 set laststatus&
16 endfunc
9 17
10 func s:get_statusline() 18 func s:get_statusline()
11 return ScreenLines(&lines - 1, &columns)[0] 19 return ScreenLines(&lines - 1, &columns)[0]
12 endfunc 20 endfunc
13 21
33 return synIDattr(synID(line("."), col("."),1), "name") 41 return synIDattr(synID(line("."), col("."),1), "name")
34 endfunc 42 endfunc
35 43
36 func Test_caught_error_in_statusline() 44 func Test_caught_error_in_statusline()
37 let s:func_in_statusline_called = 0 45 let s:func_in_statusline_called = 0
38 set laststatus=2
39 let statusline = '%{StatuslineWithCaughtError()}' 46 let statusline = '%{StatuslineWithCaughtError()}'
40 let &statusline = statusline 47 let &statusline = statusline
41 redrawstatus 48 redrawstatus
42 call assert_true(s:func_in_statusline_called) 49 call assert_true(s:func_in_statusline_called)
43 call assert_equal(statusline, &statusline) 50 call assert_equal(statusline, &statusline)
44 set statusline= 51 set statusline=
45 endfunc 52 endfunc
46 53
47 func Test_statusline_will_be_disabled_with_error() 54 func Test_statusline_will_be_disabled_with_error()
48 let s:func_in_statusline_called = 0 55 let s:func_in_statusline_called = 0
49 set laststatus=2
50 let statusline = '%{StatuslineWithError()}' 56 let statusline = '%{StatuslineWithError()}'
51 try 57 try
52 let &statusline = statusline 58 let &statusline = statusline
53 redrawstatus 59 redrawstatus
54 catch 60 catch
71 call assert_match('^ (2 of 2)\s*$', s:get_statusline()) 77 call assert_match('^ (2 of 2)\s*$', s:get_statusline())
72 e Xstatusline 78 e Xstatusline
73 call assert_match('^ ((2) of 2)\s*$', s:get_statusline()) 79 call assert_match('^ ((2) of 2)\s*$', s:get_statusline())
74 80
75 only 81 only
76 set laststatus=2
77 set splitbelow 82 set splitbelow
78 call setline(1, range(1, 10000)) 83 call setline(1, range(1, 10000))
79 84
80 " %b: Value of character under cursor. 85 " %b: Value of character under cursor.
81 " %B: As above, in hexadecimal. 86 " %B: As above, in hexadecimal.
430 close 435 close
431 436
432 %bw! 437 %bw!
433 call delete('Xstatusline') 438 call delete('Xstatusline')
434 set statusline& 439 set statusline&
435 set laststatus&
436 set splitbelow& 440 set splitbelow&
437 endfunc 441 endfunc
438 442
439 func Test_statusline_visual() 443 func Test_statusline_visual()
440 func CallWordcount() 444 func CallWordcount()
516 520
517 " Test using a multibyte character for 'stl' and 'stlnc' items in 'fillchars' 521 " Test using a multibyte character for 'stl' and 'stlnc' items in 'fillchars'
518 " with a custom 'statusline' 522 " with a custom 'statusline'
519 func Test_statusline_mbyte_fillchar() 523 func Test_statusline_mbyte_fillchar()
520 only 524 only
521 set laststatus=2
522 set fillchars=vert:\|,fold:-,stl:━,stlnc:═ 525 set fillchars=vert:\|,fold:-,stl:━,stlnc:═
523 set statusline=a%=b 526 set statusline=a%=b
524 call assert_match('^a\+━\+b$', s:get_statusline()) 527 call assert_match('^a\+━\+b$', s:get_statusline())
525 vnew 528 vnew
526 call assert_match('^a\+━\+b━a\+═\+b$', s:get_statusline()) 529 call assert_match('^a\+━\+b━a\+═\+b$', s:get_statusline())
527 wincmd w 530 wincmd w
528 call assert_match('^a\+═\+b═a\+━\+b$', s:get_statusline()) 531 call assert_match('^a\+═\+b═a\+━\+b$', s:get_statusline())
529 set statusline& fillchars& laststatus& 532 set statusline& fillchars&
530 %bw! 533 %bw!
531 endfunc 534 endfunc
532 535
533 " Used to write beyond allocated memory. This assumes MAXPATHL is 4096 bytes. 536 " Used to write beyond allocated memory. This assumes MAXPATHL is 4096 bytes.
534 func Test_statusline_verylong_filename() 537 func Test_statusline_verylong_filename()