Mercurial > vim
annotate src/testdir/test_largefile.vim @ 10279:c5c15c818bda v8.0.0036
commit https://github.com/vim/vim/commit/97792de2762cc79cc365a8a0b858f27753179577
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 15 18:36:49 2016 +0200
patch 8.0.0036
Problem: Detecting that a job has finished may take a while.
Solution: Check for a finished job more often (Ozaki Kiichi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 15 Oct 2016 18:45:04 +0200 |
parents | c4aae9421aec |
children | fdfe44ac6a1a |
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 |