-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make failing test case succeed on test all (#651)
- Loading branch information
Showing
8 changed files
with
106 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
2025-01-20 Mats Lidell <[email protected]> | ||
|
||
* test/test-helpers-tests.el (test-helpers-test--make-random-wikiword): | ||
Add test. | ||
|
||
* test/MANIFEST: Test file for the test helpers. | ||
|
||
* test/hy-test-helpers.el (hy-make-random-wikiword): Helper for making | ||
random WikiWords. | ||
|
||
2025-01-20 Bob Weiner <[email protected]> | ||
|
||
* hsys-ert.el (require 'hbut): For 'defib'. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ | |
;; Author: Mats Lidell <[email protected]> | ||
;; | ||
;; Orig-Date: 30-Jan-21 at 12:00:00 | ||
;; Last-Mod: 20-Jan-25 at 01:39:41 by Bob Weiner | ||
;; Last-Mod: 21-Jan-25 at 17:05:46 by Mats Lidell | ||
;; | ||
;; SPDX-License-Identifier: GPL-3.0-or-later | ||
;; | ||
;; Copyright (C) 2021-2024 Free Software Foundation, Inc. | ||
;; Copyright (C) 2021-2025 Free Software Foundation, Inc. | ||
;; See the "HY-COPY" file for license information. | ||
;; | ||
;; This file is part of GNU Hyperbole. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ | |
;; Author: Mats Lidell <[email protected]> | ||
;; | ||
;; Orig-Date: 30-Jan-21 at 12:00:00 | ||
;; Last-Mod: 15-Dec-24 at 14:24:42 by Bob Weiner | ||
;; Last-Mod: 21-Jan-25 at 17:02:36 by Mats Lidell | ||
;; | ||
;; SPDX-License-Identifier: GPL-3.0-or-later | ||
;; | ||
;; Copyright (C) 2021-2024 Free Software Foundation, Inc. | ||
;; Copyright (C) 2021-2025 Free Software Foundation, Inc. | ||
;; See the "HY-COPY" file for license information. | ||
;; | ||
;; This file is part of GNU Hyperbole. | ||
|
@@ -100,5 +100,22 @@ Checks ACTYPE, ARGS, LOC, LBL-KEY and NAME." | |
(kill-buffer buf)) | ||
(delete-directory dir))) | ||
|
||
(defun hy-make-random-wikiword (&optional length word-length) | ||
"Create a random WikiWord (string). | ||
The WikiWord will have a total of LENGTH characters. Each word part of | ||
the WikiWord will have WORD-LENGTH characters. The default LENGTH is 12 | ||
and the default WORD-LENGTH is 4." | ||
(unless length | ||
(setq length 12)) | ||
(unless word-length | ||
(setq word-length 4)) | ||
(let ((chars (vconcat (number-sequence ?a ?z))) | ||
(result "")) | ||
(dotimes (i length) | ||
(when (zerop (mod i word-length)) | ||
(setq result (concat result " "))) | ||
(setq result (concat result (char-to-string (elt chars (random (length chars))))))) | ||
(replace-regexp-in-string "[[:space:]]" "" (capitalize result)))) | ||
|
||
(provide 'hy-test-helpers) | ||
;;; hy-test-helpers.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ | |
;; Author: Mats Lidell <[email protected]> | ||
;; | ||
;; Orig-Date: 19-Jun-21 at 22:42:00 | ||
;; Last-Mod: 18-Jan-25 at 22:46:39 by Bob Weiner | ||
;; Last-Mod: 21-Jan-25 at 17:04:35 by Mats Lidell | ||
;; | ||
;; SPDX-License-Identifier: GPL-3.0-or-later | ||
;; | ||
;; Copyright (C) 2021-2024 Free Software Foundation, Inc. | ||
;; Copyright (C) 2021-2025 Free Software Foundation, Inc. | ||
;; See the "HY-COPY" file for license information. | ||
;; | ||
;; This file is part of GNU Hyperbole. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
;;; test-helpers-tests.el --- tests of the test helpers -*- lexical-binding: t; -*- | ||
;; | ||
;; Author: Mats Lidell | ||
;; | ||
;; Orig-Date: 20-Jan-25 at 20:22:05 | ||
;; Last-Mod: 21-Jan-25 at 17:02:12 by Mats Lidell | ||
;; | ||
;; SPDX-License-Identifier: GPL-3.0-or-later | ||
;; | ||
;; Copyright (C) 2025 Free Software Foundation, Inc. | ||
;; See the "HY-COPY" file for license information. | ||
;; | ||
;; This file is part of GNU Hyperbole. | ||
|
||
;;; Commentary: | ||
;; | ||
;; These are tests for the test helpers used in other tests. | ||
|
||
;;; Code: | ||
|
||
(require 'ert) | ||
(require 'hy-test-helpers) | ||
|
||
(unless (fboundp #'char-uppercase-p) | ||
(defun char-uppercase-p (char) | ||
"Return non-nil if CHAR is an upper-case character. | ||
If the Unicode tables are not yet available, e.g. during bootstrap, | ||
then gives correct answers only for ASCII characters." | ||
(cond ((unicode-property-table-internal 'lowercase) | ||
(characterp (get-char-code-property char 'lowercase))) | ||
((<= ?A char ?Z))))) | ||
|
||
(ert-deftest test-helpers-test--make-random-wikiword () | ||
"Verify hy-make-random-wikiword." | ||
(should (= 12 (length (hy-make-random-wikiword)))) | ||
(dolist (wwl '(3 9 21)) | ||
(dolist (wl '(2 3 9)) | ||
(let ((ww (hy-make-random-wikiword wwl wl))) | ||
(should (= wwl (length ww))) | ||
(should (char-uppercase-p (string-to-char (substring ww 0 1)))) | ||
(should-not (char-uppercase-p (string-to-char (substring ww 1 2)))))))) | ||
|
||
(provide 'test-helpers-tests) | ||
;;; test-helpers-tests.el ends here |