Skip to content

Commit 66d87cf

Browse files
committed
Verify searching all file types with matches gives @loc> headers
1 parent c371a2d commit 66d87cf

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2023-11-25 Mats Lidell <[email protected]>
2+
3+
* test/hyrolo-tests.el (hyrolo-fgrep-find-all-types-of-files): Test that
4+
all files types are searched, matches and give proper @loc>-header.
5+
16
2023-11-21 Bob Weiner <[email protected]>
27

38
* hui-select.el (hui-select-initialize): Fix to set 'syntax-table-sym'

test/hyrolo-tests.el

+20-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Mats Lidell <[email protected]>
44
;;
55
;; Orig-Date: 19-Jun-21 at 22:42:00
6-
;; Last-Mod: 17-Nov-23 at 10:48:26 by Bob Weiner
6+
;; Last-Mod: 25-Nov-23 at 00:16:26 by Mats Lidell
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -270,5 +270,24 @@ and {b} the previous same level cell."
270270
(should (string= (buffer-string) sorted-hyrolo-file)))
271271
(hy-delete-file-and-buffer hyrolo-file))))
272272

273+
(ert-deftest hyrolo-fgrep-find-all-types-of-files ()
274+
"Verify that all types of files are found in an fgrep search."
275+
(let* ((temporary-file-directory (make-temp-file "hypb" t))
276+
(org-file (make-temp-file "hypb" nil ".org" "string\n"))
277+
(kotl-file (make-temp-file "hypb" nil ".kotl" "string"))
278+
(md-file (make-temp-file "hypb" nil ".md" "string\n"))
279+
(outl-file (make-temp-file "hypb" nil ".otl" "string\n"))
280+
(hyrolo-file-list (list temporary-file-directory)))
281+
(unwind-protect
282+
(progn
283+
(hyrolo-fgrep "string")
284+
(with-current-buffer "*HyRolo*"
285+
(should (= (how-many "@loc>") 4))
286+
(dolist (f (list org-file kotl-file md-file outl-file))
287+
(should (= (how-many (concat "@loc> \"" f "\"")) 1)))))
288+
(dolist (f (list org-file kotl-file md-file outl-file))
289+
(hy-delete-file-and-buffer f))
290+
(delete-directory temporary-file-directory))))
291+
273292
(provide 'hyrolo-tests)
274293
;;; hyrolo-tests.el ends here

0 commit comments

Comments
 (0)