vim-patch:9.1.1312: tests: Test_backupskip() fails when HOME is defined (#33504)

Problem:  tests: Test_backupskip() fails when HOME is defined
Solution: unset $HOME temporarily

ad503fe927

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-04-17 07:44:42 +08:00
committed by GitHub
parent f9f6dc4262
commit 95a255a548

View File

@@ -1137,11 +1137,14 @@ func Test_backupskip()
call setenv(var, '/duplicate/path')
endfor
" unset $HOME, so that it won't try to read init files
let saveenv['HOME'] = getenv("HOME")
call setenv('HOME', v:null)
exe 'silent !' . cmd
call assert_equal(['errors:'], readfile('Xtestout'))
" restore environment variables
for var in ['TMPDIR', 'TMP', 'TEMP']
for var in ['TMPDIR', 'TMP', 'TEMP', 'HOME']
call setenv(var, saveenv[var])
endfor