diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2020-08-28 10:26:32 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2020-08-28 10:26:32 +0200 |
commit | f5ed8ded9d0169b159280a7aad5baf5c1e4e1371 (patch) | |
tree | 44d4b7d088d7f6c7b22c8033dbdcacff0cdf2d2e /test/src | |
parent | 43d0fbd270dd34bf3c75354c9bd186df490a4875 (diff) | |
download | emacs-f5ed8ded9d0169b159280a7aad5baf5c1e4e1371.tar.gz |
* test/src/fileio-tests.el: Preserve HOME when a test fails
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/fileio-tests.el | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index ba160681470..7baa4c7e2fa 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el @@ -98,26 +98,24 @@ Also check that an encoding error can appear in a symlink." (ert-deftest fileio-tests--relative-HOME () "Test that expand-file-name works even when HOME is relative." - (let ((old-home (getenv "HOME"))) + (let ((process-environment (copy-sequence process-environment))) (setenv "HOME" "a/b/c") (should (equal (expand-file-name "~/foo") (expand-file-name "a/b/c/foo"))) (when (memq system-type '(ms-dos windows-nt)) ;; Test expansion of drive-relative file names. (setenv "HOME" "x:foo") - (should (equal (expand-file-name "~/bar") "x:/foo/bar"))) - (setenv "HOME" old-home))) + (should (equal (expand-file-name "~/bar") "x:/foo/bar"))))) (ert-deftest fileio-tests--HOME-trailing-slash () "Test that expand-file-name of \"~\" respects trailing slash." - (let ((old-home (getenv "HOME"))) + (let ((process-environment (copy-sequence process-environment))) (dolist (home (if (memq system-type '(windows-nt ms-dos)) '("c:/a/b/c" "c:/a/b/c/") '("/a/b/c" "/a/b/c/"))) (setenv "HOME" home) - (should (equal (expand-file-name "~") (expand-file-name home)))) - (setenv "HOME" old-home))) + (should (equal (expand-file-name "~") (expand-file-name home)))))) (ert-deftest fileio-tests--expand-file-name-trailing-slash () (dolist (fooslashalias '("foo/" "foo//" "foo/." "foo//." "foo///././." |