[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 32f0d10126 47/47: Merge pull request #344 fro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 32f0d10126 47/47: Merge pull request #344 from rswgnu/verify-expected-url-was-called |
Date: |
Sun, 25 Jun 2023 15:58:40 -0400 (EDT) |
branch: externals/hyperbole
commit 32f0d10126dd2600097f8ef8a425c80db47ddf25
Merge: db55e1a77b 66c9368c93
Author: Robert Weiner <rsw@gnu.org>
Commit: GitHub <noreply@github.com>
Merge pull request #344 from rswgnu/verify-expected-url-was-called
Verify url is called
---
ChangeLog | 6 ++++++
test/demo-tests.el | 45 +++++++++++++++++++++++++++++++++++----------
2 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 978c7890d1..f46e802793 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,12 @@
* Makefile (LOAD_EL): Avoid the trailing quotation mark.
+2023-06-22 Mats Lidell <matsl@gnu.org>
+
+* test/demo-tests.el (hypb-should-browse-demo-was-called) Add check that
+ url was called.
+ (demo-www-test-with-quotes): Test for url in quotes.
+
2023-06-22 Bob Weiner <rsw@gnu.org>
* man/hyperbole.texi (By Menu): Add section similar to that of Ibuts,
documenting
diff --git a/test/demo-tests.el b/test/demo-tests.el
index a8f48b2246..1431c44c1d 100644
--- a/test/demo-tests.el
+++ b/test/demo-tests.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 30-Jan-21 at 12:00:00
-;; Last-Mod: 19-Feb-23 at 23:16:00 by Mats Lidell
+;; Last-Mod: 22-Jun-23 at 20:35:55 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -307,9 +307,12 @@
(should (string= "*mail*" (buffer-name))))
(hy-test-helpers:kill-buffer "*mail*")))
+(defvar hypb-should-browse-demo-was-called nil
+ "If non nil if the should-browse function was called.")
(defun demo-should-browse-twitter-url (url &optional new-window)
"Verify call with proper URL and optional NEW-WINDOW."
+ (setq hypb-should-browse-demo-was-called t)
(should (equal url "https://twitter.com/search?q=@fsf"))
(should (equal new-window nil)))
@@ -318,12 +321,14 @@
(with-temp-buffer
(insert "tw@fsf")
(goto-char 2)
- (let ((browse-url-browser-function 'demo-should-browse-twitter-url))
- (action-key))))
-
+ (let ((browse-url-browser-function 'demo-should-browse-twitter-url)
+ (hypb-should-browse-demo-was-called nil))
+ (action-key)
+ (should hypb-should-browse-demo-was-called))))
(defun demo-should-browse-github-url (url &optional new-window)
"Verify call with proper URL and optional NEW-WINDOW."
+ (setq hypb-should-browse-demo-was-called t)
(should (equal url "https://github.com/rswgnu/hyperbole"))
(should (equal new-window nil)))
@@ -333,8 +338,24 @@
(insert "https://github.com/rswgnu/hyperbole")
(goto-char 4)
(let ((browse-url-browser-function 'demo-should-browse-github-url)
- (hibtypes-github-default-user "rswgnu"))
- (action-key))))
+ (hibtypes-github-default-user "rswgnu")
+ (hypb-should-browse-demo-was-called nil))
+ (action-key)
+ (should hypb-should-browse-demo-was-called))))
+
+(ert-deftest demo-www-test-with-quotes ()
+ (let ((file (make-temp-file "hypb_" nil)))
+ (unwind-protect
+ (progn
+ (find-file file)
+ (insert "\"https://github.com/rswgnu/hyperbole\"")
+ (goto-char 4)
+ (let ((browse-url-browser-function 'demo-should-browse-github-url)
+ (hibtypes-github-default-user "rswgnu")
+ (hypb-should-browse-demo-was-called nil))
+ (action-key)
+ (should hypb-should-browse-demo-was-called)))
+ (hy-delete-file-and-buffer file))))
;; Github
(ert-deftest demo-github-user-default-test ()
@@ -342,16 +363,20 @@
(insert "gh#/hyperbole")
(goto-char 4)
(let ((browse-url-browser-function 'demo-should-browse-github-url)
- (hibtypes-github-default-user "rswgnu"))
- (action-key))))
+ (hibtypes-github-default-user "rswgnu")
+ (hypb-should-browse-demo-was-called nil))
+ (action-key)
+ (should hypb-should-browse-demo-was-called))))
(ert-deftest demo-github-ignore-default-test ()
(with-temp-buffer
(insert "gh#/rswgnu/hyperbole")
(goto-char 4)
(let ((browse-url-browser-function 'demo-should-browse-github-url)
- (hibtypes-github-default-user "whatever"))
- (action-key))))
+ (hibtypes-github-default-user "whatever")
+ (hypb-should-browse-demo-was-called nil))
+ (action-key)
+ (should hypb-should-browse-demo-was-called))))
;; Occur
(ert-deftest demo-occur-test ()
- [elpa] externals/hyperbole 11411b78f3 28/47: Insert missing Changelog item, (continued)
- [elpa] externals/hyperbole 11411b78f3 28/47: Insert missing Changelog item, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 9752451675 25/47: Keep lisp-indent-function, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 9f4f3c82d7 29/47: Remove FIXME comments, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 3d67247f58 30/47: Remove odd code duplication, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 0872ab55c0 36/47: Merge branch 'stefan-scratch-hyperbole-20230621-without-questions-no-fixme' into rsw_stefan-scratch-hyperbole-20230621-without-questions-no-fixme, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole cbb15c43fe 38/47: Merge pull request #347 from rswgnu/stefan-scratch-hyperbole-20230621-without-questions-no-fixme, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole ac036b5f29 41/47: Merge branch 'master' into insert_missing_changelog_entry, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 5bbc6da4e0 42/47: Fix annot-bib ibtype and actype; was not checking for [] delimiters, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole feb6fb1a75 43/47: Merge pull request #350 from rswgnu/rsw, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 66c9368c93 46/47: Merge branch 'master' into verify-expected-url-was-called, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 32f0d10126 47/47: Merge pull request #344 from rswgnu/verify-expected-url-was-called,
ELPA Syncer <=
- [elpa] externals/hyperbole 9b067ab55f 16/47: * hyrolo.el: A few cosmetic tweaks, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 5cd4136599 06/47: Get rid of `hyperb:stack-frame`, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 575b8b321b 15/47: Fix a few minor miscompilations and warnings, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 84a0209c59 02/47: hui:ebut-link-directly, hui:ibut-link-directly now work from kbd, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 6e73c42284 07/47: Fix compilation of test file, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 32eca132c9 09/47: * hact.el: Fix broken lexical-binding cookie, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 96791538ce 22/47: Revert FIXME, keep for now because of issues with web modes, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 5d5914c197 12/47: * hycontrol.el (hycontrol-windows-mode-map): Don't autoload, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole 9fbab74a10 13/47: * hui-select.el: Fix a few warnings and improve some docstrings, ELPA Syncer, 2023/06/25
- [elpa] externals/hyperbole e9fabc86f6 24/47: Changes applied separately, ELPA Syncer, 2023/06/25