From 953f26bace041f481e79b67b64401aa07259055c Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 16 Nov 2016 09:24:10 -0500 Subject: vim-patch:7.4.1975 Problem: On MS-Windows large files (> 2Gbyte) cause problems. Solution: Use "off_T" instead of "off_t". Use "stat_T" instead of "struct stat". Use 64 bit system functions if available. (Ken Takata) https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe Only the off_T changes are relevant, since all the "struct stat" usage is abstracted by libuv. --- src/nvim/testdir/test_largefile.vim | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/nvim/testdir/test_largefile.vim (limited to 'src/nvim/testdir/test_largefile.vim') diff --git a/src/nvim/testdir/test_largefile.vim b/src/nvim/testdir/test_largefile.vim new file mode 100644 index 0000000000..ea2b8ff62d --- /dev/null +++ b/src/nvim/testdir/test_largefile.vim @@ -0,0 +1,30 @@ +" Tests for large files +" This is only executed manually: "make test_largefile". +" 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\" + 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 + " Check if the file size is larger than 2^31 - 1 bytes. + " Note that getfsize() returns -2 if a Number is 32 bits. + let fsize=getfsize(fname) + call assert_true(fsize > 2147483647 || fsize == -2) + "call delete(fname) +endfunc -- cgit From 0164a5fea3a240efc631bc10ebf1b547c2149971 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 16 Nov 2016 14:11:15 -0500 Subject: vim-patch:7.4.1978 Problem: Large file test does not delete its output. Solution: Delete the output. Check size properly when possible. (Ken Takata) https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6 --- src/nvim/testdir/test_largefile.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/nvim/testdir/test_largefile.vim') diff --git a/src/nvim/testdir/test_largefile.vim b/src/nvim/testdir/test_largefile.vim index ea2b8ff62d..1b3e02a0c8 100644 --- a/src/nvim/testdir/test_largefile.vim +++ b/src/nvim/testdir/test_largefile.vim @@ -22,9 +22,13 @@ func Test_largefile() normal 50% normal gg w - " Check if the file size is larger than 2^31 - 1 bytes. - " Note that getfsize() returns -2 if a Number is 32 bits. + " Check if the file size is 4,000,000,000 bytes. let fsize=getfsize(fname) - call assert_true(fsize > 2147483647 || fsize == -2) - "call delete(fname) + if has('num64') + call assert_true(fsize == 4000000000) + else + " getfsize() returns -2 if a Number is 32 bits. + call assert_true(fsize == -2) + endif + call delete(fname) endfunc -- cgit