diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | test/ebuild-mode-tests.el | 44 | ||||
-rw-r--r-- | test/gentoo-newsitem-mode-tests.el | 28 |
3 files changed, 41 insertions, 38 deletions
@@ -1,3 +1,10 @@ +2024-11-15 Ulrich Müller <ulm@gentoo.org> + + * test/ebuild-mode-tests.el (ebuild-mode-test-skeleton): + * test/gentoo-newsitem-mode-tests.el + (gentoo-newsitem-test-skeleton): Override pos-visible-in-window-p + unconditionally. + 2024-11-12 Ulrich Müller <ulm@gentoo.org> * Version 1.76 released. diff --git a/test/ebuild-mode-tests.el b/test/ebuild-mode-tests.el index 9af48f6..d27d856 100644 --- a/test/ebuild-mode-tests.el +++ b/test/ebuild-mode-tests.el @@ -224,30 +224,28 @@ (getinput (lambda (&rest _args) (concat (pop testinput)))) ((symbol-function 'read-from-minibuffer) getinput) - ((symbol-function 'read-string) getinput)) + ((symbol-function 'read-string) getinput) + ;; prevent a segfault (seen with XEmacs 21.4.24 and 21.5.35) + ;; https://foss.heptapod.net/xemacs/xemacs/-/issues/6 + ((symbol-function 'pos-visible-in-window-p) + (lambda (&rest _args) t))) (ebuild-mode-test-run-with-fixed-time - (if (featurep 'xemacs) - ;; prevent a segfault (seen with XEmacs 21.4.24 and 21.5.35) - ;; https://foss.heptapod.net/xemacs/xemacs/-/issues/6 - (cl-letf (((symbol-function 'pos-visible-in-window-p) - (lambda (&rest _args) t))) - (ebuild-mode-insert-skeleton)) - (ebuild-mode-insert-skeleton))) - (should (string-equal - (buffer-string) - (concat "# Copyright 2024 Gentoo Authors\n" - "# Distributed under the terms of the " - "GNU General Public License v2\n\n" - "EAPI=8\n\n" - "DESCRIPTION=\"Skeleton test\"\n" - "HOMEPAGE=\"https://www.gentoo.org/\"\n" - "SRC_URI=\"\"\n\n" - "LICENSE=\"GPL-2+ MIT\"\n" - "SLOT=\"0\"\n" - "KEYWORDS=\"~amd64\"\n\n" - "RDEPEND=\"\"\n" - "DEPEND=\"${RDEPEND}\"\n" - "BDEPEND=\"\"\n")))))) + (ebuild-mode-insert-skeleton))) + (should (string-equal + (buffer-string) + (concat "# Copyright 2024 Gentoo Authors\n" + "# Distributed under the terms of the " + "GNU General Public License v2\n\n" + "EAPI=8\n\n" + "DESCRIPTION=\"Skeleton test\"\n" + "HOMEPAGE=\"https://www.gentoo.org/\"\n" + "SRC_URI=\"\"\n\n" + "LICENSE=\"GPL-2+ MIT\"\n" + "SLOT=\"0\"\n" + "KEYWORDS=\"~amd64\"\n\n" + "RDEPEND=\"\"\n" + "DEPEND=\"${RDEPEND}\"\n" + "BDEPEND=\"\"\n"))))) (ert-deftest ebuild-mode-test-bug-url () (skip-unless (fboundp 'bug-reference-prog-mode)) diff --git a/test/gentoo-newsitem-mode-tests.el b/test/gentoo-newsitem-mode-tests.el index 665e80d..eec4a13 100644 --- a/test/gentoo-newsitem-mode-tests.el +++ b/test/gentoo-newsitem-mode-tests.el @@ -56,21 +56,19 @@ (getinput (lambda (&rest _args) (concat (pop testinput)))) ((symbol-function 'read-from-minibuffer) getinput) - ((symbol-function 'read-string) getinput)) - (if (featurep 'xemacs) - ;; prevent a segfault (seen with XEmacs 21.4.24 and 21.5.35) - ;; https://foss.heptapod.net/xemacs/xemacs/-/issues/6 - (cl-letf (((symbol-function 'pos-visible-in-window-p) - (lambda (&rest _args) t))) - (gentoo-newsitem-insert-skeleton)) - (gentoo-newsitem-insert-skeleton)) - (should (string-equal - (buffer-string) - (concat "Title: Skeleton test\n" - "Author: Larry the Cow <larry@example.org>\n" - "Posted: 2024-08-10\n" - "Revision: 1\n" - "News-Item-Format: 2.0\n\n")))))) + ((symbol-function 'read-string) getinput) + ;; prevent a segfault (seen with XEmacs 21.4.24 and 21.5.35) + ;; https://foss.heptapod.net/xemacs/xemacs/-/issues/6 + ((symbol-function 'pos-visible-in-window-p) + (lambda (&rest _args) t))) + (gentoo-newsitem-insert-skeleton)) + (should (string-equal + (buffer-string) + (concat "Title: Skeleton test\n" + "Author: Larry the Cow <larry@example.org>\n" + "Posted: 2024-08-10\n" + "Revision: 1\n" + "News-Item-Format: 2.0\n\n"))))) (ert-deftest gentoo-newsitem-test-keybindings () (should (equal (lookup-key gentoo-newsitem-mode-map "\C-c\C-n") |