annotate src/testdir/test_largefile.vim @ 11267:588de97b40e7 v8.0.0519

patch 8.0.0519: character classes are not well tested commit https://github.com/vim/vim/commit/0c078fc7db2902d4ccba04506db082ddbef45a8c Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 29 15:31:20 2017 +0200 patch 8.0.0519: character classes are not well tested Problem: Character classes are not well tested. They can differ between platforms. Solution: Add tests. In the documentation make clear which classes depend on what library function. Only use :cntrl: and :graph: for ASCII. (Kazunobu Kuriyama, Dominique Pelle, closes #1560) Update the documentation.
author Christian Brabandt <cb@256bit.org>
date Wed, 29 Mar 2017 15:45:05 +0200
parents c4aae9421aec
children fdfe44ac6a1a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9387
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for large files
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " This is only executed manually: "make test_largefile".
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " This is not run as part of "make test".
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 func Test_largefile()
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 let fname = 'Xlarge.txt'
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call delete(fname)
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 exe "e" fname
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 " Make sure that a line break is 1 byte (LF).
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 set ff=unix
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 set undolevels=-1
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 " Input 99 'A's. The line becomes 100 bytes including a line break.
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 exe "normal 99iA\<Esc>"
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 yank
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 " Put 39,999,999 times. The file becomes 4,000,000,000 bytes.
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 normal 39999999p
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 " Moving around in the file randomly.
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 normal G
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 normal 10%
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 normal 90%
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 normal 50%
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 normal gg
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 w
9393
c4aae9421aec commit https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6
Christian Brabandt <cb@256bit.org>
parents: 9387
diff changeset
25 " Check if the file size is 4,000,000,000 bytes.
9387
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 let fsize=getfsize(fname)
9393
c4aae9421aec commit https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6
Christian Brabandt <cb@256bit.org>
parents: 9387
diff changeset
27 if has('num64')
c4aae9421aec commit https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6
Christian Brabandt <cb@256bit.org>
parents: 9387
diff changeset
28 call assert_true(fsize == 4000000000)
c4aae9421aec commit https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6
Christian Brabandt <cb@256bit.org>
parents: 9387
diff changeset
29 else
c4aae9421aec commit https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6
Christian Brabandt <cb@256bit.org>
parents: 9387
diff changeset
30 " getfsize() returns -2 if a Number is 32 bits.
c4aae9421aec commit https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6
Christian Brabandt <cb@256bit.org>
parents: 9387
diff changeset
31 call assert_true(fsize == -2)
c4aae9421aec commit https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6
Christian Brabandt <cb@256bit.org>
parents: 9387
diff changeset
32 endif
c4aae9421aec commit https://github.com/vim/vim/commit/c5af40ae646ceda817eff93b4f9ba274f031bea6
Christian Brabandt <cb@256bit.org>
parents: 9387
diff changeset
33 call delete(fname)
9387
f094d4085014 commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 endfunc