annotate src/testdir/test11.in @ 16:3ba373b54370 v7.0008

updated for version 7.0008
author vimboss
date Mon, 12 Jul 2004 15:53:54 +0000
parents 3fc0f57ecb91
children 293621502c4d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 Tests for autocommands:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 - FileWritePre writing a compressed file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 - FileReadPost reading a compressed file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 - BufNewFile reading a file template
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 - BufReadPre decompressing the file to be read
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 - FilterReadPre substituting characters in the temp file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 - FilterReadPost substituting characters after filtering
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 - FileReadPre set options for decompression
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 - FileReadPost decompress the file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 Note: This test will fail if "gzip" is not available.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 $GZIP is made empty, "-v" would cause trouble.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 Use a FileChangedShell autocommand to avoid a prompt for "Xtestfile.gz" being
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 modified outside of Vim (noticed on Solaris).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 STARTTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 :so small.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 :let $GZIP = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 :au FileChangedShell * echo "caught FileChangedShell"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 :set bin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 :au FileWritePre *.gz '[,']!gzip
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 :au FileWritePost *.gz undo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 :/start of testfile/,/end of testfile/w! Xtestfile.gz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 :au FileReadPost *.gz '[,']!gzip -d
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 :$r Xtestfile.gz " Read and decompress the testfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 :?startstart?,$w! test.out " Write contents of this file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 :au BufNewFile *.c read Xtest.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 gg/^end of testfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 :/start of test.c/+1,/end of test.c/-1w! Xtest.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 :e! foo.c " Will load Xtest.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 :au FileAppendPre *.out '[,']s/new/NEW/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 :au FileAppendPost *.out !cat Xtest.c >>test.out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 :w>>test.out " Append it to the output file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 :au! FileAppendPre
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 :" setup autocommands to decompress before reading and re-compress afterwards
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 :au BufReadPre *.gz !gzip -d <afile>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 :au BufReadPre *.gz call rename(expand("<afile>:r"), expand("<afile>"))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 :au BufReadPost *.gz call rename(expand("<afile>"), expand("<afile>:r"))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 :au BufReadPost *.gz !gzip <afile>:r
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 :e! Xtestfile.gz " Edit compressed file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 :w>>test.out " Append it to the output file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 :au FilterReadPre *.out call rename(expand("<afile>"), expand("<afile>").".t")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 :au FilterReadPre *.out !sed s/e/E/ <afile>.t ><afile>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 :au FilterReadPre *.out !rm <afile>.t
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 :au FilterReadPost *.out '[,']s/x/X/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 :e! test.out " Edit the output file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 :23,$!cat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 :au! FileReadPre *.gz !gzip -d <afile>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 :au FileReadPre *.gz call rename(expand("<afile>:r"), expand("<afile>"))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 :au! FileReadPost *.gz '[,']s/l/L/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 :$r Xtestfile.gz " Read compressed file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 :w " write it, after filtering
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 :au! " remove all autocommands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 :e " Edit test.out again
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 :set nobin ff& " use the default fileformat for writing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 :w
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 :qa!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 startstart
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 start of testfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 line 2 Abcdefghijklmnopqrstuvwxyz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 line 4 Abcdefghijklmnopqrstuvwxyz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 line 6 Abcdefghijklmnopqrstuvwxyz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 line 8 Abcdefghijklmnopqrstuvwxyz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 line 10 Abcdefghijklmnopqrstuvwxyz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 end of testfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 start of test.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 * Here is a new .c file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 end of test.c