Bram Moolenaar | 8767f52 | 2016-07-01 17:17:39 +0200 | [diff] [blame] | 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 | |
| 5 | func 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 Moolenaar | c5af40a | 2016-07-01 21:49:06 +0200 | [diff] [blame] | 25 | " Check if the file size is 4,000,000,000 bytes. |
Bram Moolenaar | 8767f52 | 2016-07-01 17:17:39 +0200 | [diff] [blame] | 26 | let fsize=getfsize(fname) |
Bram Moolenaar | 82f654e | 2020-02-17 22:12:50 +0100 | [diff] [blame] | 27 | call assert_true(fsize == 4000000000) |
Bram Moolenaar | c5af40a | 2016-07-01 21:49:06 +0200 | [diff] [blame] | 28 | call delete(fname) |
Bram Moolenaar | 8767f52 | 2016-07-01 17:17:39 +0200 | [diff] [blame] | 29 | endfunc |
Bram Moolenaar | 6d91bcb | 2020-08-12 18:50:36 +0200 | [diff] [blame] | 30 | |
| 31 | " vim: shiftwidth=2 sts=2 expandtab |