summaryrefslogtreecommitdiffstats
path: root/src/testdir/vim9.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/vim9.vim')
-rw-r--r--src/testdir/vim9.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/vim9.vim b/src/testdir/vim9.vim
index 782809bde8..764b6119db 100644
--- a/src/testdir/vim9.vim
+++ b/src/testdir/vim9.vim
@@ -112,11 +112,13 @@ enddef
# :source a list of "lines" and check whether it fails with "error"
export def CheckSourceFailure(lines: list<string>, error: string, lnum = -3)
+ var cwd = getcwd()
new
setline(1, lines)
try
assert_fails('source', error, lines, lnum)
finally
+ chdir(cwd)
bw!
endtry
enddef
@@ -124,22 +126,26 @@ enddef
# :source a list of "lines" and check whether it fails with the list of
# "errors"
export def CheckSourceFailureList(lines: list<string>, errors: list<string>, lnum = -3)
+ var cwd = getcwd()
new
setline(1, lines)
try
assert_fails('source', errors, lines, lnum)
finally
+ chdir(cwd)
bw!
endtry
enddef
# :source a list of "lines" and check whether it succeeds
export def CheckSourceSuccess(lines: list<string>)
+ var cwd = getcwd()
new
setline(1, lines)
try
:source
finally
+ chdir(cwd)
bw!
endtry
enddef