blob: 1b3e02a0c85cb534c5539fd1ec7c35ed6b089231 [file] [log] [blame]
Bram Moolenaar8767f522016-07-01 17:17:39 +02001" 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
Bram Moolenaarc5af40a2016-07-01 21:49:06 +020025 " Check if the file size is 4,000,000,000 bytes.
Bram Moolenaar8767f522016-07-01 17:17:39 +020026 let fsize=getfsize(fname)
Bram Moolenaarc5af40a2016-07-01 21:49:06 +020027 if has('num64')
28 call assert_true(fsize == 4000000000)
29 else
30 " getfsize() returns -2 if a Number is 32 bits.
31 call assert_true(fsize == -2)
32 endif
33 call delete(fname)
Bram Moolenaar8767f522016-07-01 17:17:39 +020034endfunc