diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2024-04-01 18:50:20 +0800 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2024-04-01 18:50:20 +0800 |
commit | 0fef2018445b257bf26814e6659bc2ff5b270d77 (patch) | |
tree | 2310ce1fd8781a6203ec56e2f985f6adfcc2278d /test/lisp/eshell/esh-var-tests.el | |
parent | 3a8546615a38337dc991f6546ade63a372edc2ca (diff) | |
parent | 49f76dcc17055e60569b6096e8ea3c9961ebbf63 (diff) | |
download | emacs-0fef2018445b257bf26814e6659bc2ff5b270d77.tar.gz |
Merge branch 'athena/unstable' into athena/bookworm-backports
Diffstat (limited to 'test/lisp/eshell/esh-var-tests.el')
-rw-r--r-- | test/lisp/eshell/esh-var-tests.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el index 39c278a6277..b94e8a276d7 100644 --- a/test/lisp/eshell/esh-var-tests.el +++ b/test/lisp/eshell/esh-var-tests.el @@ -653,6 +653,21 @@ nil, use FUNCTION instead." "VAR=hello\n") (should (equal (getenv "VAR") "value")))) +(ert-deftest esh-var-test/local-variables/cd () + "Test that \"VAR=value cd DIR\" properly changes the directory." + (let ((parent-directory (file-name-directory + (directory-file-name default-directory)))) + (with-temp-eshell + (eshell-insert-command "VAR=hello cd ..") + (should (equal default-directory parent-directory))))) + +(ert-deftest esh-var-test/local-variables/env () + "Test that \"env VAR=value command\" temporarily sets variables." + (with-temp-eshell + (push "VAR=value" process-environment) + (eshell-match-command-output "env VAR=hello env" "VAR=hello\n") + (should (equal (getenv "VAR") "value")))) + ;; Variable aliases |