On Tue, Aug 10, 2010 at 10:20 AM, Nazri Ramliy <[email protected]> wrote: > (Side note: Using the uppercase filename is good in that it makes sure that > the > ordering are not affected if someone runs the test from, say, the Z: drive > because it seems like the drive letter is kept at lowercase.) > > Bram, does this warrant a separate test file for test73 on windows, to cater > for djgpp?
I went ahead and created a separate test (test74.in) for testing the find completion on windows platform. Patch attached. It is in the same spirit as test73.in, but handles the fact that ":!mkdir foo" in djgpp-vim creates a "FOO" directory instead of "foo". This will also handle the likely case that someone run the test on a drive other than C:, say, Z:, using msvc-vim and test74 seems like it will run successfully because the directories will all be in uppercase while the drive letters seems to always be in lowercase. Test73 will fail in that setting. test73.in is left intact with this patch - we might want to remove windows-specific stuff in it in the future. With this patch the remaining issues are to run test the test on amiga, os2 and vms. Unfortunately I don't have access to those. nazri. -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
From 649a05c9df4e1a21c1b43ad92442634d0eec8a55 Mon Sep 17 00:00:00 2001 From: Nazri Ramliy <[email protected]> Date: Tue, 10 Aug 2010 10:58:52 +0800 Subject: [PATCH] Test script for find completion for djgpp/msvc vim --- src/testdir/Make_dos.mak | 2 +- src/testdir/test74.in | 104 ++++++++++++++++++++++++++++++++++++++++++++++ src/testdir/test74.ok | 11 +++++ 3 files changed, 116 insertions(+), 1 deletions(-) create mode 100644 src/testdir/test74.in create mode 100644 src/testdir/test74.ok diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index be253c9..f3ce72c 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -27,7 +27,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test30.out test31.out test32.out test33.out test34.out \ test37.out test38.out test39.out test40.out test41.out \ test42.out test52.out test65.out test66.out test67.out \ - test68.out test69.out test71.out test72.out test73.out + test68.out test69.out test71.out test72.out test74.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/test74.in b/src/testdir/test74.in new file mode 100644 index 0000000..ea0bf3b --- /dev/null +++ b/src/testdir/test74.in @@ -0,0 +1,104 @@ +Tests for find completion for djgpp/msvc vim. + +This test is basically the same as test73. It needs a +different file because ":!mkdir" in djgpp vim always create +uppercase-letters directory names which results in different +ordering of the find completion candidates. + +The uppercase path names used in the following vim script +emphasizes this issue. + +STARTTEST +:so small.vim +:" Do all test in a separate window to avoid E211 when we recursively +:" delete the Xfind directory during cleanup +:" +:" This will cause a few errors, do it silently. +:set nocp viminfo+=nviminfo visualbell +:" +:function! DeleteDirectory(dir) +: exec "silent !rmdir /Q /S " . a:dir +:endfun +:" A stale "Xfind" directory may exist, remove it so that +:" we start from a clean state. +:call DeleteDirectory("Xfind") +:new +:let cwd=getcwd() +:!mkdir XFIND +:cd XFIND +:set path= +:find +:w! ../test.out +:close +:new +:set path=. +:find +:w >>../test.out +:close +:new +:set path=.,, +:find +:w >>../test.out +:close +:new +:set path=./** +:find +:w >>../test.out +:close +:new +:" We shouldn't find any file at this point, ../test.out must be empty. +:!mkdir in +:cd in +:!mkdir path +:exec "cd " . cwd +:e XFIND/file.txt +SHoly Grail:w +:e XFIND/IN/file.txt +SJimmy Hoffa:w +:e XFIND/IN/stuff.txt +SAnother Holy Grail:w +:e XFIND/IN/PATH/file.txt +SE.T.:w +:set path=Xfind/** +:find file +:w >> test.out +:find file +:w >>test.out +:find file +:w >>test.out +:" Rerun the previous three find completions, using fullpath in 'path' +:exec "set path=" . cwd . "/Xfind/**" +:find file +:w >> test.out +:find file +:w >>test.out +:find file +:w >>test.out +:" Same steps again, using relative and fullpath items that point to the same +:" recursive location. +:" This is to test that there are no duplicates in the completion list. +:exec "set path+=Xfind/**" +:find file +:w >> test.out +:find file +:w >>test.out +:find file +:w >>test.out +:find file +:" Test find completion for directory of current buffer, which at this point +:" is Xfind/in/file.txt. +:set path=. +:find st +:w >> test.out +:set path=XFind/** +:" Test find completion for empty path item ",," which is the current directory +:cd Xfind +:set path=,, +:find f +:w >> ../test.out +:cd .. +:q +:call DeleteDirectory("Xfind") +:qa! +ENDTEST + diff --git a/src/testdir/test74.ok b/src/testdir/test74.ok new file mode 100644 index 0000000..ba3e9e4 --- /dev/null +++ b/src/testdir/test74.ok @@ -0,0 +1,11 @@ +Jimmy Hoffa +E.T. +Holy Grail +Jimmy Hoffa +E.T. +Holy Grail +Jimmy Hoffa +E.T. +Holy Grail +Another Holy Grail +Holy Grail -- 1.7.2.1.6.g61bf12
