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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 54d7ae565a 020/143: Complete test suite for h


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 54d7ae565a 020/143: Complete test suite for hui:link-possible-types
Date: Mon, 19 Feb 2024 15:58:48 -0500 (EST)

branch: externals/hyperbole
commit 54d7ae565a6779b73186a14134a43b83d3b2532f
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: Mats Lidell <mats.lidell@lidells.se>

    Complete test suite for hui:link-possible-types
    
    Note discrepancies from expected behavior are added as comments.
---
 test/hui-tests.el | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/test/hui-tests.el b/test/hui-tests.el
index 6e694d73db..1a28f9a887 100644
--- a/test/hui-tests.el
+++ b/test/hui-tests.el
@@ -994,10 +994,44 @@ With point on label suggest that ibut for rename."
         (should (equal (caar (hui:link-possible-types)) 'link-to-mail)))))
 
   ;; Directory Name           link-to-directory
-  ;; TBD
+  (let ((dir (make-temp-file "hypb" t)))
+    (unwind-protect
+        (let ((hargs:reading-type 'directory))
+          ;; The dired case looks identical to the general dired case
+          ;; below i.e. (let ((hargs:reading-type 'directory))
+          ;; (hui:link-possible-types)) with cursor on a line with a
+          ;; file in dired returns 'link-to-file. What is the expected
+          ;; behavior?
+          (with-current-buffer (dired dir)
+            (goto-char 1)
+            (should (equal (caar (hui:link-possible-types)) 
'link-to-directory)))
+          (with-temp-buffer
+            (insert dir)
+            (goto-char 4)
+            (should (equal (caar (hui:link-possible-types)) 'link-to-ibut))) 
;; Expected: link-to-directory
+          (with-temp-buffer
+            (insert "/ssh:user@host.org:/home/user/file\n")
+            (goto-char 4)
+            (should (equal (caar (hui:link-possible-types)) 'link-to-ibut)))) 
;; Expected: link-to-directory
+      (hy-delete-dir-and-buffer dir)))
 
   ;; File Name                link-to-file
-  ;; TBD
+  (let* ((temporary-file-directory (make-temp-file "hypb" t))
+         (file (make-temp-file "hypb")))
+    (unwind-protect
+        (let ((hargs:reading-type 'file))
+          (with-current-buffer (dired temporary-file-directory)
+            (should (equal (caar (hui:link-possible-types)) 'link-to-file)))
+          (with-temp-buffer
+            (insert temporary-file-directory)
+            (goto-char 4)
+            (should (equal (caar (hui:link-possible-types)) 'link-to-ibut))) 
;; Expected: link-to-file
+          (with-temp-buffer
+            (insert "/ssh:user@host.org:/home/user/\n")
+            (goto-char 4)
+            (should (equal (caar (hui:link-possible-types)) 'link-to-ibut)))) 
;; Expected: link-to-file
+      (hy-delete-file-and-buffer file)
+      (hy-delete-dir-and-buffer temporary-file-directory)))
 
   ;; Koutline Cell            link-to-kcell
   (let ((file (make-temp-file "hypb" nil ".kotl")))
@@ -1015,7 +1049,7 @@ With point on label suggest that ibut for rename."
           (find-file file)
           (outline-mode)
           (goto-char 1)
-          ;; BUG!? SHOULD link-to-string-match
+          ;; BUG!? Should be link-to-string-match?
           (should (equal (caar (hui:link-possible-types)) 'link-to-file)))
       (hy-delete-file-and-buffer file)))
 
@@ -1031,6 +1065,7 @@ With point on label suggest that ibut for rename."
   (let ((dir (make-temp-file "hypb" t)))
     (unwind-protect
         (with-current-buffer (dired dir)
+          (goto-char 1) ;; EOL does not seem to matter!?
           (should (equal (caar (hui:link-possible-types)) 'link-to-directory)))
       (hy-delete-dir-and-buffer dir)))
 



reply via email to

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