Mercurial > vim
annotate src/testdir/test73.in @ 2538:3d8a4a148c76 vim73
Fixes for :find completion.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 11 Aug 2010 22:05:57 +0200 |
parents | 33ee6a19522d |
children | 7a547db7070d |
rev | line source |
---|---|
2487
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
1 Tests for find completion. |
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
2 |
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
3 STARTTEST |
2514
f60d1b74b271
Fix: test 73 failed with small features.
Bram Moolenaar <bram@vim.org>
parents:
2495
diff
changeset
|
4 :so small.vim |
2495
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
5 :" Do all test in a separate window to avoid E211 when we recursively |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
6 :" delete the Xfind directory during cleanup |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
7 :" |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
8 :" This will cause a few errors, do it silently. |
2515
33ee6a19522d
Avoid that test 73 ovewrites viminfo. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2514
diff
changeset
|
9 :set nocp viminfo+=nviminfo visualbell |
2495
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
10 :" |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
11 :function! DeleteDirectory(dir) |
2538 | 12 : if has("win16") || has("win32") || has("win64") || has("dos16") || has("dos32") |
2495
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
13 : exec "silent !rmdir /Q /S " . a:dir |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
14 : else |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
15 : exec "silent !rm -rf " . a:dir |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
16 : endif |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
17 :endfun |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
18 :" On windows a stale "Xfind" directory may exist, remove it so that |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
19 :" we start from a clean state. |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
20 :call DeleteDirectory("Xfind") |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
21 :new |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
22 :let cwd=getcwd() |
2489
18c04e8d970e
Make test 73 a bit more portable.
Bram Moolenaar <bram@vim.org>
parents:
2487
diff
changeset
|
23 :!mkdir Xfind |
2495
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
24 :cd Xfind |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
25 :set path= |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
26 :find |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
27 :w! ../test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
28 :close |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
29 :new |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
30 :set path=. |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
31 :find |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
32 :w >>../test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
33 :close |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
34 :new |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
35 :set path=.,, |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
36 :find |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
37 :w >>../test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
38 :close |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
39 :new |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
40 :set path=./** |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
41 :find |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
42 :w >>../test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
43 :close |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
44 :new |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
45 :" We shouldn't find any file at this point, ../test.out must be empty. |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
46 :!mkdir in |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
47 :cd in |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
48 :!mkdir path |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
49 :exec "cd " . cwd |
2487
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
50 :e Xfind/file.txt |
2489
18c04e8d970e
Make test 73 a bit more portable.
Bram Moolenaar <bram@vim.org>
parents:
2487
diff
changeset
|
51 SHoly Grail:w |
2487
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
52 :e Xfind/in/file.txt |
2489
18c04e8d970e
Make test 73 a bit more portable.
Bram Moolenaar <bram@vim.org>
parents:
2487
diff
changeset
|
53 SJimmy Hoffa:w |
2495
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
54 :e Xfind/in/stuff.txt |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
55 SAnother Holy Grail:w |
2487
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
56 :e Xfind/in/path/file.txt |
2489
18c04e8d970e
Make test 73 a bit more portable.
Bram Moolenaar <bram@vim.org>
parents:
2487
diff
changeset
|
57 SE.T.:w |
2487
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
58 :set path=Xfind/** |
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
59 :find file |
2495
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
60 :w >> test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
61 :find file |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
62 :w >>test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
63 :find file |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
64 :w >>test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
65 :" Rerun the previous three find completions, using fullpath in 'path' |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
66 :exec "set path=" . cwd . "/Xfind/**" |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
67 :find file |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
68 :w >> test.out |
2487
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
69 :find file |
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
70 :w >>test.out |
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
71 :find file |
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
72 :w >>test.out |
2495
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
73 :" Same steps again, using relative and fullpath items that point to the same |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
74 :" recursive location. |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
75 :" This is to test that there are no duplicates in the completion list. |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
76 :exec "set path+=Xfind/**" |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
77 :find file |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
78 :w >> test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
79 :find file |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
80 :w >>test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
81 :find file |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
82 :w >>test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
83 :find file |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
84 :" Test find completion for directory of current buffer, which at this point |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
85 :" is Xfind/in/file.txt. |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
86 :set path=. |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
87 :find st |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
88 :w >> test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
89 :" Test find completion for empty path item ",," which is the current directory |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
90 :cd Xfind |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
91 :set path=,, |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
92 :find f |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
93 :w >> ../test.out |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
94 :cd .. |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
95 :q |
a847363bf06e
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents:
2489
diff
changeset
|
96 :call DeleteDirectory("Xfind") |
2487
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
97 :qa! |
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
98 ENDTEST |
7ec9ada2cd81
Make :find completion consistent between Unix and MS-Windows. Add a test.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
99 |