2016-11-16 07:24:10 -07:00
|
|
|
" Tests for large files
|
2018-09-04 09:43:06 -07:00
|
|
|
" This is only executed manually: "TEST_FILE=test_largefile.res make oldtest".
|
2016-11-16 07:24:10 -07:00
|
|
|
" This is not run as part of "make test".
|
|
|
|
|
|
|
|
func Test_largefile()
|
|
|
|
let fname = 'Xlarge.txt'
|
|
|
|
|
|
|
|
call delete(fname)
|
|
|
|
exe "e" fname
|
|
|
|
" Make sure that a line break is 1 byte (LF).
|
|
|
|
set ff=unix
|
|
|
|
set undolevels=-1
|
|
|
|
" Input 99 'A's. The line becomes 100 bytes including a line break.
|
|
|
|
exe "normal 99iA\<Esc>"
|
|
|
|
yank
|
|
|
|
" Put 39,999,999 times. The file becomes 4,000,000,000 bytes.
|
|
|
|
normal 39999999p
|
|
|
|
" Moving around in the file randomly.
|
|
|
|
normal G
|
|
|
|
normal 10%
|
|
|
|
normal 90%
|
|
|
|
normal 50%
|
|
|
|
normal gg
|
|
|
|
w
|
2016-11-16 12:11:15 -07:00
|
|
|
" Check if the file size is 4,000,000,000 bytes.
|
2016-11-16 07:24:10 -07:00
|
|
|
let fsize=getfsize(fname)
|
2020-11-26 20:36:57 -07:00
|
|
|
call assert_true(fsize == 4000000000)
|
2016-11-16 12:11:15 -07:00
|
|
|
call delete(fname)
|
2016-11-16 07:24:10 -07:00
|
|
|
endfunc
|