0
0
mirror of https://github.com/vim/vim.git synced 2025-10-05 05:34:07 -04:00

patch 8.0.0890: still many old style tests

Problem:    Still many old style tests.
Solution:   Convert several tests to new style. (Yegappan Lakshmanan)
This commit is contained in:
Bram Moolenaar
2017-08-07 22:02:30 +02:00
parent e20b3eba73
commit 75373f3808
16 changed files with 202 additions and 271 deletions

View File

@@ -416,4 +416,42 @@ func Test_next_split_all()
bwipe!
endfunc
" Tests for adjusting window and contents
func GetScreenStr(row)
let str = ""
for c in range(1,3)
let str .= nr2char(screenchar(a:row, c))
endfor
return str
endfunc
func Test_window_contents()
enew! | only | new
call setline(1, range(1,256))
exe "norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"
redraw
let s3=GetScreenStr(1)
wincmd p
call assert_equal(1, line("w0"))
call assert_equal('1 ', s3)
exe "norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"
redraw
let s3=GetScreenStr(1)
wincmd p
call assert_equal(50, line("w0"))
call assert_equal('50 ', s3)
exe "norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"
redraw
let s3=GetScreenStr(1)
wincmd p
call assert_equal(59, line("w0"))
call assert_equal('59 ', s3)
bwipeout!
call test_garbagecollect_now()
endfunc
" vim: shiftwidth=2 sts=2 expandtab