1" Tests for large files
2" This is only executed manually: "make test_largefile".
3" This is not run as part of "make test".
4
5func Test_largefile()
6  let fname = 'Xlarge.txt'
7
8  call delete(fname)
9  exe "e" fname
10  " Make sure that a line break is 1 byte (LF).
11  set ff=unix
12  set undolevels=-1
13  " Input 99 'A's. The line becomes 100 bytes including a line break.
14  exe "normal 99iA\<Esc>"
15  yank
16  " Put 39,999,999 times. The file becomes 4,000,000,000 bytes.
17  normal 39999999p
18  " Moving around in the file randomly.
19  normal G
20  normal 10%
21  normal 90%
22  normal 50%
23  normal gg
24  w
25  " Check if the file size is larger than 2^31 - 1 bytes.
26  " Note that getfsize() returns -2 if a Number is 32 bits.
27  let fsize=getfsize(fname)
28  call assert_true(fsize > 2147483647 || fsize == -2)
29  "call delete(fname)
30endfunc
31