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

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

[elpa] externals/hyperbole 9075e9e 2/2: Merge branch 'master' of hyperbo


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 9075e9e 2/2: Merge branch 'master' of hyperbole
Date: Fri, 16 Apr 2021 02:57:08 -0400 (EDT)

branch: externals/hyperbole
commit 9075e9ee803cdec8d5232aab99b684d18d61b5e1
Merge: 2f307a8 fdac2af
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    Merge branch 'master' of hyperbole
---
 Changes                | 19 +++++++++++
 hypb-ert.el            |  6 ++++
 test/demo-tests.el     |  1 +
 test/hbut-tests.el     |  8 ++---
 test/hibtypes-tests.el | 93 ++++++++++++++++++++++++++++++++++++++++++++++++--
 5 files changed, 121 insertions(+), 6 deletions(-)

diff --git a/Changes b/Changes
index 21e5b3b..b2b989d 100644
--- a/Changes
+++ b/Changes
@@ -10,6 +10,16 @@
            (hpath:expand): For compressed Elisp libraries, add any
     found compressed suffix to the path.
 
+2021-04-15  Mats Lidell  <matsl@gnu.org>
+
+* test/hibtypes-tests.el (ibtypes::pathname-anchor-test)
+    (ibtypes::pathname-anchor-line-test, ibtypes::pathname-line-column-test)
+    (ibtypes::pathname-load-path-line-column-test)
+    (ibtypes::pathname-with-dash-loads-file-test)
+    (ibtypes::pathname-directory-test)
+    (ibtypes::pathname-dot-slash-in-other-folder-test)
+    (ibtypes::pathname-dot-slash-in-same-folder-test): Pathname test cases.
+
 2021-04-15  Bob Weiner  <rsw@gnu.org>
 
 * hpath.el (hpath:call): Add to wrap functions that test path validity,
@@ -52,6 +62,15 @@
 * hsettings.el (hyperbole-web-search): Optimize and make service-name
     matching case-insensitive.
 
+2021-04-11  Mats Lidell  <matsl@gnu.org>
+
+* test/hibtypes-tests.el (ibtypes::ctags-vgrind-test)
+    (ibtypes::etags-test): Make tests independent of default directory.
+
+* test/demo-tests.el (demo-manifest-test): Make test more robust.
+
+* hypb-ert.el (hypb-run-all-tests): Run all hyperbole tests.
+
 2021-04-07  Bob Weiner  <rsw@gnu.org>
 
 * hbut.el (ibut:label-separator): Explain usage properly in doc string.
diff --git a/hypb-ert.el b/hypb-ert.el
index 3a593b3..df0c556 100644
--- a/hypb-ert.el
+++ b/hypb-ert.el
@@ -42,5 +42,11 @@
 (defal hypb-ert-sym 'hypb-run-ert-test-symbol)
 (defal hypb-ert-sel 'hypb-run-ert-test-selector)
 
+(defun hypb-run-all-tests ()
+  "Run every ert test."
+  (interactive)
+  (mapc 'load-file (directory-files (expand-file-name "test" hyperb:dir) t 
"\\.el$"))
+  (ert t))
+
 (provide 'hypb-ert)
 ;;; hypb-ert.el ends here
diff --git a/test/demo-tests.el b/test/demo-tests.el
index d552de3..22c83be 100644
--- a/test/demo-tests.el
+++ b/test/demo-tests.el
@@ -255,6 +255,7 @@
   (unwind-protect
       (progn
         (find-file (expand-file-name "MANIFEST" hyperb:dir))
+        (beginning-of-buffer)
         (forward-line 1)
         (should (looking-at "COPYING"))
         (action-key)
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index 41cb6aa..7445dbd 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -30,7 +30,7 @@
         (insert "<defal-path DEMO>")
         (goto-char 4)
         (action-key)
-        (should (string= (concat hyperb:dir "DEMO") buffer-file-name))))
+        (should (string= (expand-file-name "DEMO" hyperb:dir) 
buffer-file-name))))
     (progn
       (kill-buffer "DEMO")
       (ibtype:delete 'ibtypes::defal-path)))
@@ -111,7 +111,7 @@ the button text"
         (insert "<<<DEMO>>>")
         (goto-char 4)
         (action-key)
-        (should (string= (concat hyperb:dir "DEMO") buffer-file-name)))
+        (should (string= (expand-file-name "DEMO" hyperb:dir) 
buffer-file-name)))
     (progn
       (kill-buffer "DEMO")
       (ibtype:delete 'ibtypes::defil-path-it))))
@@ -154,7 +154,7 @@ the button text"
   (with-temp-buffer
     (insert "<[emacs]>: \"${hyperb:dir}/DEMO\"")
     (goto-char 4)
-    (hy-test-helpers:action-key-should-call-hpath:find (concat hyperb:dir 
"DEMO"))))
+    (hy-test-helpers:action-key-should-call-hpath:find (expand-file-name 
"DEMO" hyperb:dir))))
 
 (ert-deftest hbut-ib-link-to-file-with-label-variants ()
   (cl-loop for ch in '(?: ?- ?=) do
@@ -162,7 +162,7 @@ the button text"
                     (with-temp-buffer
                       (insert "<[demo]>" (make-string n ch) " 
\"${hyperb:dir}/DEMO\"")
                       (goto-char 4)
-                      (hy-test-helpers:action-key-should-call-hpath:find 
(concat hyperb:dir "DEMO"))))))
+                      (hy-test-helpers:action-key-should-call-hpath:find 
(expand-file-name "DEMO" hyperb:dir))))))
 
 (ert-deftest hbut-ib-url-with-label ()
   "Should find link but fails with (user-error \"No link found\")"
diff --git a/test/hibtypes-tests.el b/test/hibtypes-tests.el
index 4be61b5..cacdc6c 100644
--- a/test/hibtypes-tests.el
+++ b/test/hibtypes-tests.el
@@ -89,6 +89,95 @@
         (should (string= "hyperbole.el" (buffer-name)))))
   (kill-buffer "hyperbole.el"))
 
+(ert-deftest ibtypes::pathname-anchor-test ()
+  "Pathname with anchor."
+  (unwind-protect
+      (with-temp-buffer
+        (insert "\"${hyperb:dir}/DEMO#Smart Keys\"")
+        (goto-char 2)
+        (ibtypes::pathname)
+        (should (string= "DEMO" (buffer-name)))
+        (should (looking-at "\* Smart Keys")))
+    (kill-buffer "DEMO")))
+
+(ert-deftest ibtypes::pathname-anchor-line-test ()
+  "Pathname with anchor and line specification."
+  (unwind-protect
+      (with-temp-buffer
+        (insert "\"${hyperb:dir}/DEMO#Smart Keys:2\"")
+        (goto-char 2)
+        (ibtypes::pathname)
+        (should (string= "DEMO" (buffer-name)))
+        (forward-line -2)
+        (should (looking-at "\* Smart Keys")))
+    (kill-buffer "DEMO")))
+
+(ert-deftest ibtypes::pathname-line-column-test ()
+  "Pathname with line and position specification."
+  (unwind-protect
+      (with-temp-buffer
+        (insert "\"${hyperb:dir}/DEMO:3:45\"")
+        (goto-char 2)
+        (ibtypes::pathname-line-and-column)
+        (should (string= "DEMO" (buffer-name)))
+        (should (= (line-number-at-pos) 3))
+        (should (= (current-column) 45)))
+    (kill-buffer "DEMO")))
+
+(ert-deftest ibtypes::pathname-load-path-line-column-test ()
+  "Pathname with line and position specification."
+  (unwind-protect
+      (with-temp-buffer
+        (insert "\"${load-path}/hypb.el:10:5\"")
+        (goto-char 2)
+        (ibtypes::pathname-line-and-column)
+        (should (string= "hypb.el" (buffer-name)))
+        (should (= (line-number-at-pos) 10))
+        (should (= (current-column) 5)))
+    (kill-buffer "hypb.el")))
+
+(ert-deftest ibtypes::pathname-with-dash-loads-file-test ()
+  "Pathname with dash loads file.
+Bug: Fails with 'Invalid function: hact'."
+  :expected-result :failed
+  (with-temp-buffer
+    (insert "\"-${hyperb:dir}/test/hy-test-dependencies.el\"")
+    (goto-char 2)
+    (ibtypes::pathname)))
+
+(ert-deftest ibtypes::pathname-directory-test ()
+  "Pathname with directory opens dired."
+  (unwind-protect
+      (with-temp-buffer
+        (insert "\"/tmp\"")
+        (goto-char 2)
+        (ibtypes::pathname)
+        (should (string= "tmp" (buffer-name)))
+        (should (eq major-mode 'dired-mode)))
+    (kill-buffer "tmp")))
+
+(ert-deftest ibtypes::pathname-dot-slash-in-other-folder-test ()
+  "Pathname that starts with ./ only works if in same folder."
+  (with-temp-buffer
+    (insert "\"./hypb.el\"")
+    (goto-char 2)
+    (let ((help-buffer "*Help: Hyperbole Action Key*")
+          (default-directory (expand-file-name "test" hyperb:dir)))
+      (hkey-help)
+      (set-buffer help-buffer)
+      (should (string-match "no matching context" (buffer-string))))))
+
+(ert-deftest ibtypes::pathname-dot-slash-in-same-folder-test ()
+  "Pathname that starts with ./ only works if in same folder."
+  (with-temp-buffer
+    (insert "\"./hypb.el\"")
+    (goto-char 2)
+    (let ((help-buffer "*Help: Hyperbole Action Key*")
+          (default-directory hyperb:dir))
+      (hkey-help)
+      (set-buffer help-buffer)
+      (should (string-match "actype:.*link-to-file" (buffer-string))))))
+
 ;; Function in buffer XEmac functionality. Is there somethign similar in Emacs?
 
 ;; ibtypes::annot-bib
@@ -121,7 +210,7 @@
         (insert "hy-test-helpers:consume-input-events hy-test-helpers.el 21\n")
         (goto-char (point-min))
         (forward-char 4)
-        (let ((default-directory (concat default-directory "test")))
+        (let ((default-directory (expand-file-name "test" hyperb:dir)))
           (ibtypes::ctags)
           (set-buffer "hy-test-helpers.el")
           (should (looking-at "(defun hy-test-helpers:consume-input-events"))))
@@ -138,7 +227,7 @@
         (goto-char (point-min))
         (forward-line 2)
         (forward-char 10)
-        (let ((default-directory (concat default-directory "test")))
+        (let ((default-directory (expand-file-name "test" hyperb:dir)))
           (ibtypes::etags)
           (set-buffer "hy-test-helpers.el")
           (should (looking-at "(defun hy-test-helpers:consume-input-events"))))



reply via email to

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