Mercurial > vim
comparison src/testdir/test73.in @ 9254:05e7d084c6c2 v7.4.1910
commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jun 8 21:48:50 2016 +0200
patch 7.4.1910
Problem: Tests using external command to delete directory.
Solution: Use delete().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 08 Jun 2016 22:00:06 +0200 |
parents | 3887b02953ce |
children | ae45d497868f |
comparison
equal
deleted
inserted
replaced
9253:949eb1171f2b | 9254:05e7d084c6c2 |
---|---|
7 :" | 7 :" |
8 :" This will cause a few errors, do it silently. | 8 :" This will cause a few errors, do it silently. |
9 :set visualbell | 9 :set visualbell |
10 :set nocp viminfo+=nviminfo | 10 :set nocp viminfo+=nviminfo |
11 :" | 11 :" |
12 :function! DeleteDirectory(dir) | |
13 : if has("win16") || has("win32") || has("win64") || has("dos16") || has("dos32") | |
14 : exec "silent !rmdir /Q /S " . a:dir | |
15 : else | |
16 : exec "silent !rm -rf " . a:dir | |
17 : endif | |
18 :endfun | |
19 :" On windows a stale "Xfind" directory may exist, remove it so that | 12 :" On windows a stale "Xfind" directory may exist, remove it so that |
20 :" we start from a clean state. | 13 :" we start from a clean state. |
21 :call DeleteDirectory("Xfind") | 14 :call delete("Xfind", "rf") |
22 :new | 15 :new |
23 :let cwd=getcwd() | 16 :let cwd=getcwd() |
24 :let test_out = cwd . '/test.out' | 17 :let test_out = cwd . '/test.out' |
25 :call mkdir('Xfind') | 18 :call mkdir('Xfind') |
26 :cd Xfind | 19 :cd Xfind |
168 :" Search for the file containing Holy Grail in same directory as in/path.txt | 161 :" Search for the file containing Holy Grail in same directory as in/path.txt |
169 :find stu | 162 :find stu |
170 :exec "w >>" . test_out | 163 :exec "w >>" . test_out |
171 :q | 164 :q |
172 :exec "cd " . cwd | 165 :exec "cd " . cwd |
173 :call DeleteDirectory("Xfind") | 166 :call delete("Xfind", "rf") |
174 :qa! | 167 :qa! |
175 ENDTEST | 168 ENDTEST |
176 | 169 |