[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 5d27b22695 129/143: Add overview and top-leve
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 5d27b22695 129/143: Add overview and top-level outline tests |
Date: |
Mon, 19 Feb 2024 15:59:26 -0500 (EST) |
branch: externals/hyperbole
commit 5d27b22695139ad9a573fb8d23a7172567b971a0
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: Mats Lidell <mats.lidell@lidells.se>
Add overview and top-level outline tests
---
ChangeLog | 12 +++++++
test/hyrolo-tests.el | 90 +++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 97 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3a7c5ce484..80072b9773 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-02-12 Mats Lidell <matsl@gnu.org>
+
+* test/hyrolo-tests.el (hyrolo-tests--modify-test-data): Helper for
+ modifying org test data for outline and markdown files.
+ (hyrolo-tests--outline-content-otl)
+ (hyrolo-tests--outline-content-md): Use hyrolo-tests--modify-test-data.
+ (hyrolo-tests---org-expected-outline-for-top-level)
+ (hyrolo-tests---org-expected-outline-for-overview): Add expected
+ outline for org test data.
+ (hyrolo-tests--top-level-outline-for-all-file-types): Test top level
outline.
+ (hyrolo-tests--overview-outline-for-all-file-types): Test overview outline.
+
2024-02-08 Mats Lidell <matsl@gnu.org>
* test/hyrolo-tests.el: Make hide tests more forgiving about hiding
diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el
index 82edf07c59..5a8c19749c 100644
--- a/test/hyrolo-tests.el
+++ b/test/hyrolo-tests.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 19-Jun-21 at 22:42:00
-;; Last-Mod: 8-Feb-24 at 13:57:13 by Mats Lidell
+;; Last-Mod: 12-Feb-24 at 22:53:26 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -991,14 +991,19 @@ body
"
"Outline content for org files.")
+(defun hyrolo-tests--modify-test-data (star type str)
+ "Replace * with STAR and org with TYPE in STR.
+Useful for creating outline and markdown test data from org examples."
+ (replace-regexp-in-string
+ "org" type
+ (replace-regexp-in-string (regexp-quote "*") star str)))
+
(defconst hyrolo-tests--outline-content-otl
- (replace-regexp-in-string "org" "otl" hyrolo-tests--outline-content-org)
+ (hyrolo-tests--modify-test-data "*" "otl" hyrolo-tests--outline-content-org)
"Outline content for otl files.")
(defconst hyrolo-tests--outline-content-md
- (replace-regexp-in-string
- (regexp-quote "*") "#"
- (replace-regexp-in-string "org" "md" hyrolo-tests--outline-content-org))
+ (hyrolo-tests--modify-test-data "#" "md" hyrolo-tests--outline-content-org)
"Outline content for markdown files.")
(ert-deftest hyrolo-tests--forward-same-level-org-level2 ()
@@ -1366,5 +1371,80 @@ body
(kill-buffer hyrolo-display-buffer)
(hy-delete-files-and-buffers hyrolo-file-list))))
+(defconst hyrolo-tests---org-expected-outline-for-top-level
+ "\
+* h-org 1...
+* h-org 2...
+"
+ "Expected outline for org test data.")
+
+(ert-deftest hyrolo-tests--top-level-outline-for-all-file-types ()
+ "Verify `hyrolo-top-level' shows first level for all supported file types."
+ (let* ((org-file1 (make-temp-file "hypb" nil ".org"
hyrolo-tests--outline-content-org))
+ (otl-file1 (make-temp-file "hypb" nil ".otl"
hyrolo-tests--outline-content-otl))
+ (md-file1 (make-temp-file "hypb" nil ".md"
hyrolo-tests--outline-content-md))
+ (kotl-file1 (hyrolo-tests--gen-kotl-outline "h-kotl" "body" 2))
+ (hyrolo-file-list (list org-file1 otl-file1 md-file1 kotl-file1)))
+ (unwind-protect
+ (progn
+ (hyrolo-grep "body")
+ (hyrolo-top-level)
+
+ (should (string=
+ (concat (hyrolo-tests--hyrolo-section-header org-file1)
+ hyrolo-tests---org-expected-outline-for-top-level
+ (hyrolo-tests--hyrolo-section-header otl-file1)
+ (hyrolo-tests--modify-test-data "*" "otl"
hyrolo-tests---org-expected-outline-for-top-level)
+ (hyrolo-tests--hyrolo-section-header md-file1)
+ (hyrolo-tests--modify-test-data "#" "md"
hyrolo-tests---org-expected-outline-for-top-level)
+ (hyrolo-tests--hyrolo-section-header kotl-file1)
+ "\
+ 1. h-kotl...
+ 1a. h-kotl 1...
+")
+ (hyrolo-tests--outline-as-string))))
+ (kill-buffer hyrolo-display-buffer)
+ (hy-delete-files-and-buffers hyrolo-file-list))))
+
+(defconst hyrolo-tests---org-expected-outline-for-overview
+ "\
+* h-org 1...
+** h-org 1.1...
+** h-org 1.2...
+*** h-org 1.2.1...
+* h-org 2...
+** h-org-2.1...
+"
+ "Expected outline for org test data.")
+
+(ert-deftest hyrolo-tests--overview-outline-for-all-file-types ()
+ "Verify `hyrolo-overview' shows all level headings for all supported file
types."
+ (let* ((org-file1 (make-temp-file "hypb" nil ".org"
hyrolo-tests--outline-content-org))
+ (otl-file1 (make-temp-file "hypb" nil ".otl"
hyrolo-tests--outline-content-otl))
+ (md-file1 (make-temp-file "hypb" nil ".md"
hyrolo-tests--outline-content-md))
+ (kotl-file1 (hyrolo-tests--gen-kotl-outline "h-kotl" "body" 2))
+ (hyrolo-file-list (list org-file1 otl-file1 md-file1 kotl-file1)))
+ (unwind-protect
+ (progn
+ (hyrolo-grep "body")
+ (hyrolo-overview nil)
+
+ (should (string=
+ (concat (hyrolo-tests--hyrolo-section-header org-file1)
+ hyrolo-tests---org-expected-outline-for-overview
+ (hyrolo-tests--hyrolo-section-header otl-file1)
+ (hyrolo-tests--modify-test-data "*" "otl"
hyrolo-tests---org-expected-outline-for-overview)
+ (hyrolo-tests--hyrolo-section-header md-file1)
+ (hyrolo-tests--modify-test-data "#" "md"
hyrolo-tests---org-expected-outline-for-overview)
+ (hyrolo-tests--hyrolo-section-header kotl-file1)
+ "\
+ 1. h-kotl...
+ 1a. h-kotl 1...
+ 1a1. h-kotl 2...
+")
+ (hyrolo-tests--outline-as-string))))
+ (kill-buffer hyrolo-display-buffer)
+ (hy-delete-files-and-buffers hyrolo-file-list))))
+
(provide 'hyrolo-tests)
;;; hyrolo-tests.el ends here
- [elpa] externals/hyperbole 30ec5b242a 083/143: Merge pull request #440 from rswgnu/matsl-rsw-add-tests-for-various-ebut, (continued)
- [elpa] externals/hyperbole 30ec5b242a 083/143: Merge pull request #440 from rswgnu/matsl-rsw-add-tests-for-various-ebut, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 89b2477423 094/143: Remove skip guard on test that works in batch mode, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 4c28ade4aa 093/143: Respect EMACS macro in echo target (#446), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 48210fb535 091/143: Fix hyrolo-to-entry-beginning, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole edeaad38cd 102/143: Set copyright notice to include 2024 for files updated under 2024 (#453), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 44b5b447f7 101/143: Add hsettings tests (#452), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 9def89866a 112/143: HyRolo - (hyrolo-markdown-mode): Add missing (require 'markdown-mode), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole cf6c291eae 124/143: Rename ibut:act to ibut:act-label, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole c0f33ab989 095/143: hsys-org-fix-version - fix to reload Org libs from the proper path, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole f40a30d11c 127/143: Use actionv4 (#465), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 5d27b22695 129/143: Add overview and top-level outline tests,
ELPA Syncer <=
- [elpa] externals/hyperbole 6befc489c5 131/143: Autoload `hypb:add-to-invisibility-spec' used in kotl-mode, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole c5b276b61e 142/143: HyRolo - `hyrolo-outline-minor-mode' expands invisible text at point, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 93ff5acf4b 140/143: hyrolo.el - Add default hyrolo-entry-group-number for hyrolo-mode, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole b3a0a7d2e2 038/143: Merge remote branch 'rsw' of hyperbole into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 6c7b8e5afb 048/143: Add helper for generating org files + two tests using the matches, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 8d9b7f0dde 032/143: hyrolo-tests.el - "*HyRolo*" literal to `hyrolo-display-buffer' var, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole c2bf47c15b 068/143: xref is used by etags since 26.1 so use it unconditionally (#432), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 327f53f078 069/143: Mock y-or-n-p to avoid being prompted (#433), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole e88a3873ed 073/143: htype:def-symbol, htype:names, actype:def-symbol - Call update, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole eeb6aacd9f 075/143: Add more hyrolo show, hide and movement tests (#436), ELPA Syncer, 2024/02/19