Mercurial > vim
comparison src/testdir/test40.in @ 4131:ad7b6062a7f4 v7.3.818
updated for version 7.3.818
Problem: When test 40 fails because of a bad build it may leave files
behind that cause it to fail later.
Solution: Let the file names start with "X".
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 14 Feb 2013 20:58:35 +0100 |
parents | 3fc0f57ecb91 |
children |
comparison
equal
deleted
inserted
replaced
4130:e85607b2f196 | 4131:ad7b6062a7f4 |
---|---|
1 Test for "*Cmd" autocommands | 1 Test for "*Cmd" autocommands |
2 | 2 |
3 STARTTEST | 3 STARTTEST |
4 :so small.vim | 4 :so small.vim |
5 :/^start/,$w! Xxx " write lines below to Xxx | 5 :/^start/,$w! Xxx " write lines below to Xxx |
6 :au BufReadCmd testA 0r Xxx|$del | 6 :au BufReadCmd XtestA 0r Xxx|$del |
7 :e testA " will read text of Xxd instead | 7 :e XtestA " will read text of Xxd instead |
8 :au BufWriteCmd testA call append(line("$"), "write") | 8 :au BufWriteCmd XtestA call append(line("$"), "write") |
9 :w " will append a line to the file | 9 :w " will append a line to the file |
10 :r testA " should not read anything | 10 :r XtestA " should not read anything |
11 : " now we have: | 11 : " now we have: |
12 : " 1 start of Xxx | 12 : " 1 start of Xxx |
13 : " 2 test40 | 13 : " 2 test40 |
14 : " 3 end of Xxx | 14 : " 3 end of Xxx |
15 : " 4 write | 15 : " 4 write |
16 :au FileReadCmd testB '[r Xxx | 16 :au FileReadCmd XtestB '[r Xxx |
17 :2r testB " will read Xxx below line 2 instead | 17 :2r XtestB " will read Xxx below line 2 instead |
18 : " 1 start of Xxx | 18 : " 1 start of Xxx |
19 : " 2 test40 | 19 : " 2 test40 |
20 : " 3 start of Xxx | 20 : " 3 start of Xxx |
21 : " 4 test40 | 21 : " 4 test40 |
22 : " 5 end of Xxx | 22 : " 5 end of Xxx |
23 : " 6 end of Xxx | 23 : " 6 end of Xxx |
24 : " 7 write | 24 : " 7 write |
25 :au FileWriteCmd testC '[,']copy $ | 25 :au FileWriteCmd XtestC '[,']copy $ |
26 4GA1 | 26 4GA1 |
27 :4,5w testC " will copy lines 4 and 5 to the end | 27 :4,5w XtestC " will copy lines 4 and 5 to the end |
28 :r testC " should not read anything | 28 :r XtestC " should not read anything |
29 : " 1 start of Xxx | 29 : " 1 start of Xxx |
30 : " 2 test40 | 30 : " 2 test40 |
31 : " 3 start of Xxx | 31 : " 3 start of Xxx |
32 : " 4 test401 | 32 : " 4 test401 |
33 : " 5 end of Xxx | 33 : " 5 end of Xxx |
34 : " 6 end of Xxx | 34 : " 6 end of Xxx |
35 : " 7 write | 35 : " 7 write |
36 : " 8 test401 | 36 : " 8 test401 |
37 : " 9 end of Xxx | 37 : " 9 end of Xxx |
38 :au FILEAppendCmd testD '[,']w! test.out | 38 :au FILEAppendCmd XtestD '[,']w! test.out |
39 :w >>testD " will write all lines to test.out | 39 :w >>XtestD " will write all lines to test.out |
40 :$r testD " should not read anything | 40 :$r XtestD " should not read anything |
41 :$w >>test.out " append "end of Xxx" to test.out | 41 :$w >>test.out " append "end of Xxx" to test.out |
42 :au BufReadCmd testE 0r test.out|$del | 42 :au BufReadCmd XtestE 0r test.out|$del |
43 :sp testE " split window with test.out | 43 :sp XtestE " split window with test.out |
44 5Goasdf:" | 44 5Goasdf:" |
45 :au BufWriteCmd testE w! test.out | 45 :au BufWriteCmd XtestE w! test.out |
46 :wall " will write other window to test.out | 46 :wall " will write other window to test.out |
47 : " 1 start of Xxx | 47 : " 1 start of Xxx |
48 : " 2 test40 | 48 : " 2 test40 |
49 : " 3 start of Xxx | 49 : " 3 start of Xxx |
50 : " 4 test401 | 50 : " 4 test401 |