[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/eat 8188f71562 8/9: * eat-tests.el (eat-test-set-cwd): Upd
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/eat 8188f71562 8/9: * eat-tests.el (eat-test-set-cwd): Update test |
Date: |
Tue, 6 Dec 2022 13:58:46 -0500 (EST) |
branch: elpa/eat
commit 8188f71562d6dac35b747a63bd16ec06e0396724
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
* eat-tests.el (eat-test-set-cwd): Update test
---
eat-tests.el | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/eat-tests.el b/eat-tests.el
index 476072587c..0fa1677e81 100644
--- a/eat-tests.el
+++ b/eat-tests.el
@@ -5752,25 +5752,32 @@ Write plain text and newline to move cursor."
(ert-deftest eat-test-set-cwd ()
"Test setting current working directory."
(eat--tests-with-term '()
- (let ((cwd default-directory))
- (should (string= (eat-term-cwd (terminal)) default-directory))
+ (let ((cwd default-directory)
+ (host (system-name)))
+ (should (string= (car (eat-term-cwd (terminal))) host))
+ (should (string= (cdr (eat-term-cwd (terminal))) cwd))
(setf (eat-term-set-cwd-function (terminal))
- (lambda (term dir)
+ (lambda (term hostname dir)
(should (eq term (terminal)))
- (setq cwd dir)))
+ (setq cwd dir)
+ (setq host hostname)))
;; file://HOST/PATH/.
- (output (format "\e]7;file://%s/foo/bar/\e\\" (system-name)))
+ (output (format "\e]51;e;A;%s;%s\e\\"
+ (base64-encode-string "frob")
+ (base64-encode-string "/foo/bar/")))
+ (should (string= host "frob"))
+ (should (string= (car (eat-term-cwd (terminal))) "frob"))
(should (string= cwd "/foo/bar/"))
- (should (string= (eat-term-cwd (terminal)) "/foo/bar/"))
+ (should (string= (cdr (eat-term-cwd (terminal))) "/foo/bar/"))
+ (should-term :cursor '(1 . 1))
;; file://HOST/PATH (note the missing trailing slash).
- (output (format "\e]7;file://%s/bar/baz\a" (system-name)))
+ (output (format "\e]51;e;A;%s;%s\e\\"
+ (base64-encode-string "foo")
+ (base64-encode-string "/bar/baz")))
+ (should (string= host "foo"))
+ (should (string= (car (eat-term-cwd (terminal))) "foo"))
(should (string= cwd "/bar/baz/"))
- (should (string= (eat-term-cwd (terminal)) "/bar/baz/"))
- ;; file://SOME-OTHER-HOST/PATH/
- (output (format "\e]7;file://%s/baz/foo/\e\\"
- (if (string= (system-name) "foo") "bar" "foo")))
- (should (string= cwd "/bar/baz/"))
- (should (string= (eat-term-cwd (terminal)) "/bar/baz/"))
+ (should (string= (cdr (eat-term-cwd (terminal))) "/bar/baz/"))
(should-term :cursor '(1 . 1)))))
- [nongnu] elpa/eat updated (d35864ca6b -> 693940c733), ELPA Syncer, 2022/12/06
- [nongnu] elpa/eat 693940c733 9/9: * README.org: Add shell integration instructions, ELPA Syncer, 2022/12/06
- [nongnu] elpa/eat 8188f71562 8/9: * eat-tests.el (eat-test-set-cwd): Update test,
ELPA Syncer <=
- [nongnu] elpa/eat 62a09caef1 7/9: * eat.el (eat--t-term): Fix initial value of 'cwd', ELPA Syncer, 2022/12/06
- [nongnu] elpa/eat a04999011f 3/9: Annotate shell prompts, ELPA Syncer, 2022/12/06
- [nongnu] elpa/eat e287487b42 6/9: Document everything about shell integration, ELPA Syncer, 2022/12/06
- [nongnu] elpa/eat 2c6afa4dc0 4/9: Add shell prompt navigation commands, ELPA Syncer, 2022/12/06
- [nongnu] elpa/eat 9caa496e45 1/9: Tighter shell integration, ELPA Syncer, 2022/12/06
- [nongnu] elpa/eat b42687f146 5/9: Fix prompt navigation when annotation is disabled, ELPA Syncer, 2022/12/06
- [nongnu] elpa/eat b4d07cb474 2/9: Add shell commands run in Eat to Emacs history, ELPA Syncer, 2022/12/06