summaryrefslogtreecommitdiffstats
path: root/src/testdir/runtest.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/runtest.vim')
-rw-r--r--src/testdir/runtest.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 08c0e684bf..8eef1669fd 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -103,6 +103,10 @@ func RunTheTest(test)
" buffers.
%bwipe!
+ " The test may change the current directory. Save and restore the
+ " directory after executing the test.
+ let save_cwd = getcwd()
+
if exists("*SetUp")
try
call SetUp()
@@ -157,6 +161,8 @@ func RunTheTest(test)
break
endif
endwhile
+
+ exe 'cd ' . save_cwd
endfunc
func AfterTheTest()