[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/toc-org f13f79737a 020/128: Wrap test call with `(eval-aft
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/toc-org f13f79737a 020/128: Wrap test call with `(eval-after-load "ert-autoloads"...) |
Date: |
Sun, 2 Jan 2022 09:59:06 -0500 (EST) |
branch: elpa/toc-org
commit f13f79737add47bbcfa6afca8dc4645079f99e3a
Author: Antoine R. Dumont <antoine.romain.dumont@gmail.com>
Commit: Antoine R. Dumont <antoine.romain.dumont@gmail.com>
Wrap test call with `(eval-after-load "ert-autoloads"...)
---
org-toc.el | 114 ++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 59 insertions(+), 55 deletions(-)
diff --git a/org-toc.el b/org-toc.el
index aae3ee60b8..f90461ac3b 100644
--- a/org-toc.el
+++ b/org-toc.el
@@ -95,35 +95,36 @@ tags."
(buffer-substring-no-properties
(point-min) (point-max)))))
-(ert-deftest org-toc-test-raw-toc ()
- "Test the `org-toc-raw-toc' function"
-
- (defun org-toc-test-raw-toc-gold-test (content gold)
- (should (equal
- (with-temp-buffer
- (insert content)
- (org-toc-raw-toc))
- gold)))
-
- (let ((beg "* About\n:TOC:\n drawer\n:END:\n\norg-toc is a utility to have
an up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n\n* Table of Contents
")
- (gold "* About\n"))
-
- ;; different TOC styles
- (org-toc-test-raw-toc-gold-test (concat beg ":TOC:" ) gold)
- (org-toc-test-raw-toc-gold-test (concat beg ":TOC_1:" ) gold)
- (org-toc-test-raw-toc-gold-test (concat beg ":TOC_1_qqq:" ) gold)
- (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1:" ) gold)
- (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1@cxv:" ) gold)
- (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1_hello:" ) gold)
-
- ;; trailing symbols
- (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1_hello:" "\n\n\n") gold)
- (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1_hello:" "\n\n\nsdfd")
gold))
-
- ;; more complex case
- (org-toc-test-raw-toc-gold-test
- "* About\n:TOC:\n drawer\n:END:\n\norg-toc is a utility to have an
up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n\n* Table of Contents
:TOC:\n - [[#about][About]]\n -
[[#use][Use]]\n - [[#different-href-styles][Different href st [...]
- "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different
href styles\n* Example\n"))
+(eval-after-load "ert-autoloads"
+ (ert-deftest org-toc-test-raw-toc ()
+ "Test the `org-toc-raw-toc' function"
+
+ (defun org-toc-test-raw-toc-gold-test (content gold)
+ (should (equal
+ (with-temp-buffer
+ (insert content)
+ (org-toc-raw-toc))
+ gold)))
+
+ (let ((beg "* About\n:TOC:\n drawer\n:END:\n\norg-toc is a utility to have
an up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n\n* Table of Contents
")
+ (gold "* About\n"))
+
+ ;; different TOC styles
+ (org-toc-test-raw-toc-gold-test (concat beg ":TOC:" ) gold)
+ (org-toc-test-raw-toc-gold-test (concat beg ":TOC_1:" ) gold)
+ (org-toc-test-raw-toc-gold-test (concat beg ":TOC_1_qqq:" ) gold)
+ (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1:" ) gold)
+ (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1@cxv:" ) gold)
+ (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1_hello:" ) gold)
+
+ ;; trailing symbols
+ (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1_hello:" "\n\n\n")
gold)
+ (org-toc-test-raw-toc-gold-test (concat beg ":TOC@1_hello:"
"\n\n\nsdfd") gold))
+
+ ;; more complex case
+ (org-toc-test-raw-toc-gold-test
+ "* About\n:TOC:\n drawer\n:END:\n\norg-toc is a utility to have an
up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n\n* Table of Contents
:TOC:\n - [[#about][About]]\n -
[[#use][Use]]\n - [[#different-href-styles][Different href [...]
+ "* About\n* Installation\n** via package.el\n** Manual\n* Use\n*
Different href styles\n* Example\n")))
(defun org-toc-hrefify-gh (str)
"Given a heading, transform it into a href using the GitHub
@@ -133,11 +134,12 @@ rules."
(special-chars-fix (replace-regexp-in-string
org-toc-special-chars-regexp "" upcase-fix t)))
(concat "#" special-chars-fix)))
-(ert-deftest org-toc-test-hrefify-gh ()
- "Test the `org-toc-hrefify-gh' function"
- (should (equal (org-toc-hrefify-gh "About") "#about"))
- (should (equal (org-toc-hrefify-gh "!h@#$%^&*(){}|][:;\"'/?.>,<`~") "#h"))
- (should (equal (org-toc-hrefify-gh "!h@#$% ^&*(S){}|][:;\"'/?.>,<`~")
"#h-s")))
+(eval-after-load "ert-autoloads"
+ (ert-deftest org-toc-test-hrefify-gh ()
+ "Test the `org-toc-hrefify-gh' function"
+ (should (equal (org-toc-hrefify-gh "About") "#about"))
+ (should (equal (org-toc-hrefify-gh "!h@#$%^&*(){}|][:;\"'/?.>,<`~") "#h"))
+ (should (equal (org-toc-hrefify-gh "!h@#$% ^&*(S){}|][:;\"'/?.>,<`~")
"#h-s"))))
(defun org-toc-hrefify-org (str)
"Given a heading, transform it into a href using the org-mode
@@ -177,11 +179,12 @@ each heading into a link."
(buffer-substring-no-properties
(point-min) (point-max))))
-(ert-deftest org-toc-test-hrefify-toc ()
- (should (equal (org-toc-hrefify-toc "* About\n" 'upcase)
- " - [[ABOUT][About]]\n"))
- (should (equal (org-toc-hrefify-toc "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 'upcase)
- " - [[ABOUT][About]]\n - [[INSTALLATION][Installation]]\n
- [[VIA PACKAGE.EL][via package.el]]\n - [[MANUAL][Manual]]\n -
[[USE][Use]]\n - [[DIFFERENT HREF STYLES][Different href styles]]\n -
[[EXAMPLE][Example]]\n")))
+(eval-after-load "ert-autoloads"
+ (ert-deftest org-toc-test-hrefify-toc ()
+ (should (equal (org-toc-hrefify-toc "* About\n" 'upcase)
+ " - [[ABOUT][About]]\n"))
+ (should (equal (org-toc-hrefify-toc "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 'upcase)
+ " - [[ABOUT][About]]\n - [[INSTALLATION][Installation]]\n
- [[VIA PACKAGE.EL][via package.el]]\n - [[MANUAL][Manual]]\n -
[[USE][Use]]\n - [[DIFFERENT HREF STYLES][Different href styles]]\n -
[[EXAMPLE][Example]]\n"))))
(defun org-toc-flush-subheadings (toc max-depth)
"Flush subheadings of the raw `toc' deeper than `max-depth'."
@@ -197,22 +200,23 @@ each heading into a link."
(buffer-substring-no-properties
(point-min) (point-max))))
-(ert-deftest org-toc-test-flush-subheadings ()
- (should (equal (org-toc-flush-subheadings "* About\n" 0)
- ""))
- (should (equal (org-toc-flush-subheadings "* About\n" 1)
- "* About\n"))
- (should (equal (org-toc-flush-subheadings "* About\n" 2)
- "* About\n"))
-
- (should (equal (org-toc-flush-subheadings "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 0)
- ""))
- (should (equal (org-toc-flush-subheadings "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 1)
- "* About\n* Installation\n* Use\n* Different href styles\n*
Example\n"))
- (should (equal (org-toc-flush-subheadings "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 2)
- "* About\n* Installation\n** via package.el\n** Manual\n*
Use\n* Different href styles\n* Example\n"))
- (should (equal (org-toc-flush-subheadings "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 3)
- "* About\n* Installation\n** via package.el\n** Manual\n*
Use\n* Different href styles\n* Example\n")))
+(eval-after-load "ert-autoloads"
+ (ert-deftest org-toc-test-flush-subheadings ()
+ (should (equal (org-toc-flush-subheadings "* About\n" 0)
+ ""))
+ (should (equal (org-toc-flush-subheadings "* About\n" 1)
+ "* About\n"))
+ (should (equal (org-toc-flush-subheadings "* About\n" 2)
+ "* About\n"))
+
+ (should (equal (org-toc-flush-subheadings "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 0)
+ ""))
+ (should (equal (org-toc-flush-subheadings "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 1)
+ "* About\n* Installation\n* Use\n* Different href styles\n*
Example\n"))
+ (should (equal (org-toc-flush-subheadings "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 2)
+ "* About\n* Installation\n** via package.el\n** Manual\n*
Use\n* Different href styles\n* Example\n"))
+ (should (equal (org-toc-flush-subheadings "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 3)
+ "* About\n* Installation\n** via package.el\n** Manual\n*
Use\n* Different href styles\n* Example\n"))))
(defun org-toc-insert-toc ()
"Looks for a headline with the TOC tag and updates it with the
- [nongnu] elpa/toc-org f345f768cb 051/128: Merge pull request #13 from JAremko/master, (continued)
- [nongnu] elpa/toc-org f345f768cb 051/128: Merge pull request #13 from JAremko/master, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org ac2c33dcf8 055/128: remove unnecessary spaces, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 1d52ece078 016/128: another fix to travis badge, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org fdfb7574dc 068/128: fix travis build, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 40c6754d9f 083/128: replacs string-join with mapconcat, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 356b3fbb89 101/128: Define fake markdown mode in tests, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 2c4ff18a4e 092/128: document quote functionality, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 4315afd2a4 095/128: fix readme, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org cf4a624b78 122/128: Add license file with GPLv3, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 2539b4be40 097/128: add test for parenthesis in custom TODO words declaration, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org f13f79737a 020/128: Wrap test call with `(eval-after-load "ert-autoloads"...),
ELPA Syncer <=
- [nongnu] elpa/toc-org e9cf57041a 008/128: fix heading regexp, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org abbcb67166 011/128: allow _ as seprartor, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org ad3424d457 067/128: move tests to a separate file, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 5a8a3f9b3a 080/128: Merge pull request #42 from snosov1/remove-opening-space, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org aa52bd036d 071/128: handle headlines with COMMENT, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org d30b57f16d 077/128: Merge pull request #40 from alphapapa/update-primary-docstring, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 37f3bf2733 112/128: Add tests for the case-sensitive COMMENT regexp, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 4d259c9cea 086/128: Merge pull request #51 from snosov1/work-in-derived-modes, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org cd1868787c 087/128: Fix Emacs 26 warning, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 3315ef6c96 106/128: Merge pull request #66 from snosov1/enable-toc-org-for-markdown, ELPA Syncer, 2022/01/02