blob: 4d0e2f051f2fe09695e21dbb3aefb9b9263627e3 [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 Moolenaar82f654e2020-02-17 22:12:50 +010027 call assert_true(fsize == 4000000000)
Bram Moolenaarc5af40a2016-07-01 21:49:06 +020028 call delete(fname)
Bram Moolenaar8767f522016-07-01 17:17:39 +020029endfunc
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +020030
31" vim: shiftwidth=2 sts=2 expandtab