emacs-elpa-diffs
[Top][All Lists]
Advanced

[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)))))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]