diff options
author | Jim Porter <jporterbugs@gmail.com> | 2022-07-08 18:41:07 -0700 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-07-12 15:10:56 +0200 |
commit | ba1923f1f1bba69bc13620042a00e315946ba82a (patch) | |
tree | d85dddc36fb0957a0209fa15bbf1b7dcef339191 /test/lisp/eshell/em-dirs-tests.el | |
parent | e51ae63ec28c46f37436f649d6421859c1ad0077 (diff) | |
download | emacs-ba1923f1f1bba69bc13620042a00e315946ba82a.tar.gz emacs-ba1923f1f1bba69bc13620042a00e315946ba82a.tar.bz2 emacs-ba1923f1f1bba69bc13620042a00e315946ba82a.zip |
Allow Eshell variable aliases to point to other aliases
In particular, this resolves an issue where '$+' referenced the real
environment variable '$PWD' instead of the Eshell variable alias of
the same name. This meant that changing directories in Eshell
wouldn't update the value of '$+'.
* lisp/eshell/esh-var.el (eshell-get-variable): Allow Eshell variable
aliaes to point to other aliases.
* test/lisp/eshell/em-dirs-tests.el (em-dirs-test/pwd-var)
(em-dirs-test/short-pwd-var): Adapt tests to check this case
(bug#56509).
Diffstat (limited to 'test/lisp/eshell/em-dirs-tests.el')
-rw-r--r-- | test/lisp/eshell/em-dirs-tests.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/lisp/eshell/em-dirs-tests.el b/test/lisp/eshell/em-dirs-tests.el index eb27acd208e..69480051e49 100644 --- a/test/lisp/eshell/em-dirs-tests.el +++ b/test/lisp/eshell/em-dirs-tests.el @@ -36,13 +36,15 @@ (ert-deftest em-dirs-test/pwd-var () "Test using the $PWD variable." - (should (equal (eshell-test-command-result "echo $PWD") - (expand-file-name (eshell/pwd))))) + (let ((default-directory "/some/path")) + (should (equal (eshell-test-command-result "echo $PWD") + (expand-file-name default-directory))))) (ert-deftest em-dirs-test/short-pwd-var () "Test using the $+ (current directory) variable." - (should (equal (eshell-test-command-result "echo $+") - (expand-file-name (eshell/pwd))))) + (let ((default-directory "/some/path")) + (should (equal (eshell-test-command-result "echo $+") + (expand-file-name default-directory))))) (ert-deftest em-dirs-test/oldpwd-var () "Test using the $OLDPWD variable." |