aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVladimir Sedach2023-06-26 22:30:25 -0600
committerEli Zaretskii2023-07-08 19:30:06 +0300
commit44c9293ddd8b335981c2fcac22b1c4b6cf451e2f (patch)
tree565649bfe2965906c9c3f7c30420fee978819f61 /test
parent8ffe8422c53e196787c6f404e4cadc7029a7fbd9 (diff)
downloademacs-44c9293ddd8b335981c2fcac22b1c4b6cf451e2f.tar.gz
emacs-44c9293ddd8b335981c2fcac22b1c4b6cf451e2f.zip
; * test/lisp/shell-tests.el: Add tests for shell-dirtrack-mode (bug#64311)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/shell-tests.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el
index db9124e2435..ddddfdb2e0f 100644
--- a/test/lisp/shell-tests.el
+++ b/test/lisp/shell-tests.el
@@ -64,4 +64,35 @@
64 (should (equal (split-string-shell-command "ls /tmp/foo\\ bar") 64 (should (equal (split-string-shell-command "ls /tmp/foo\\ bar")
65 '("ls" "/tmp/foo bar"))))) 65 '("ls" "/tmp/foo bar")))))
66 66
67(ert-deftest shell-dirtrack-on-by-default ()
68 (with-temp-buffer
69 (shell-mode)
70 (should shell-dirtrack-mode)))
71
72(ert-deftest shell-dirtrack-should-not-be-on-in-unrelated-modes ()
73 (with-temp-buffer
74 (should (not shell-dirtrack-mode))))
75
76(ert-deftest shell-dirtrack-sets-list-buffers-directory ()
77 (let ((start-dir default-directory))
78 (with-temp-buffer
79 (should-not list-buffers-directory)
80 (shell-mode)
81 (shell-cd "..")
82 (should list-buffers-directory)
83 (should (not (equal start-dir list-buffers-directory)))
84 (should (string-prefix-p list-buffers-directory start-dir)))))
85
86(ert-deftest shell-directory-tracker-cd ()
87 (let ((start-dir default-directory))
88 (with-temp-buffer
89 (should-not list-buffers-directory)
90 (shell-mode)
91 (cl-letf (((symbol-function 'shell-unquote-argument)
92 (lambda (x) x)))
93 (shell-directory-tracker "cd .."))
94 (should list-buffers-directory)
95 (should (not (equal start-dir list-buffers-directory)))
96 (should (string-prefix-p list-buffers-directory start-dir)))))
97
67;;; shell-tests.el ends here 98;;; shell-tests.el ends here