[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode a0ddf0f02d 034/199: added tests for images
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode a0ddf0f02d 034/199: added tests for images |
Date: |
Sun, 3 Sep 2023 06:59:26 -0400 (EDT) |
branch: elpa/adoc-mode
commit a0ddf0f02d417fc4d5d32b1480420d03ee9e6429
Author: Florian Kaufmann <sensorflo@gmail.com>
Commit: Florian Kaufmann <sensorflo@gmail.com>
added tests for images
---
adoc-mode-test.el | 42 ++++++++++++++++++++++++++++++++++++++++--
adoc-mode.el | 12 ++++++------
2 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/adoc-mode-test.el b/adoc-mode-test.el
index b3f045881a..c6f7678f35 100644
--- a/adoc-mode-test.el
+++ b/adoc-mode-test.el
@@ -1,4 +1,3 @@
-
(require 'ert)
(require 'adoc-mode)
@@ -135,6 +134,45 @@
;; tested in delimited-blocks-simple
))
+(ert-deftest adoctest-test-images ()
+ (adoctest-faces "images"
+ ;; block macros
+ ;; empty arglist
+ "image" markup-complex-replacement-face "::" markup-meta-face
+ "./foo/bar.png" markup-internal-reference-face
+ "[]" markup-meta-face "\n" nil
+ ;; pos attribute 0 = alternate text
+ "image" markup-complex-replacement-face "::" markup-meta-face
+ "./foo/bar.png" markup-internal-reference-face
+ "[" markup-meta-face "lorem ipsum" markup-secondary-text-face "]"
markup-meta-face "\n" nil
+ ;; keyword title
+ "image" markup-complex-replacement-face "::" markup-meta-face
+ "./foo/bar.png" markup-internal-reference-face
+ "[" markup-meta-face "alt" markup-attribute-face "=" markup-meta-face
"lorem ipsum" markup-secondary-text-face "]" markup-meta-face "\n" nil
+ ;; keyword alt and title
+ "image" markup-complex-replacement-face "::" markup-meta-face
+ "./foo/bar.png" markup-internal-reference-face
+ "[" markup-meta-face "alt" markup-attribute-face "=" markup-meta-face
"lorem ipsum" markup-secondary-text-face "," markup-meta-face
+ "title" markup-attribute-face "=" markup-meta-face "lorem ipsum"
markup-secondary-text-face "]" markup-meta-face "\n" nil
+
+ ;; no everything again with inline macros
+ "foo " 'no-face "image" markup-complex-replacement-face ":"
markup-meta-face
+ "./foo/bar.png" markup-internal-reference-face
+ "[]" markup-meta-face "bar" 'no-face "\n" nil
+
+ "foo " 'no-face "image" markup-complex-replacement-face ":"
markup-meta-face
+ "./foo/bar.png" markup-internal-reference-face
+ "[" markup-meta-face "lorem ipsum" markup-secondary-text-face "]"
markup-meta-face "bar" 'no-face "\n" nil
+
+ "foo " 'no-face "image" markup-complex-replacement-face ":"
markup-meta-face
+ "./foo/bar.png" markup-internal-reference-face
+ "[" markup-meta-face "alt" markup-attribute-face "=" markup-meta-face
"lorem ipsum" markup-secondary-text-face "]" markup-meta-face "bar" 'no-face
"\n" nil
+
+ "foo " 'no-face "image" markup-complex-replacement-face ":"
markup-meta-face
+ "./foo/bar.png" markup-internal-reference-face
+ "[" markup-meta-face "alt" markup-attribute-face "=" markup-meta-face
"lorem ipsum" markup-secondary-text-face "," markup-meta-face
+ "title" markup-attribute-face "=" markup-meta-face "lorem ipsum"
markup-secondary-text-face "]" markup-meta-face "bar" 'no-face "\n" nil))
+
(ert-deftest adoctest-test-attribute-list ()
(adoctest-faces "attribute-list"
;; positional attribute
@@ -372,5 +410,5 @@
(save-buffer "adoc-mode.el")
(save-buffer "adoc-mode-test.el")
(ert-run-tests-interactively "^adoctest-pre-test-byte-compile")
- (ert-run-tests-interactively "^adoctest-test"))
+ (ert-run-tests-interactively "^adoctest-test-"))
diff --git a/adoc-mode.el b/adoc-mode.el
index 42a8fe5887..7e7d8640b2 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -721,7 +721,7 @@ Subgroups:
2 target
3 attribute list, exclusive brackets []"
;; !!! \< is not exactly what AsciiDoc does, see regex above
- (concat "\\<\\(" cmd-name "\\):\\([^ \t\n].*\\)[\\(.*?\\)]" ))
+ (concat "\\<\\(" cmd-name "\\):\\([^ \t\n].*\\)\\[\\(.*?\\)\\]" ))
;; todo: use same regexps as for font lock
(defun adoc-re-paragraph-separate ()
@@ -1009,10 +1009,10 @@ When LITERAL-P is non-nil, the contained text is
literal text."
'(0 '(face markup-meta-face adoc-reserved t) t)
'(1 markup-complex-replacement-face t)
'(2 markup-internal-reference-face t)
- '(3 '(face markup-delimiter-face
+ '(3 '(face markup-meta-face
adoc-reserved nil
adoc-attribute-list (((0 "alt") markup-secondary-text-face)
- ("title" markup-secondary-text-face))))))
+ ("title" markup-secondary-text-face))) t)))
;; bug: escapes are not handled yet
;; todo: give the inserted character a specific face. But I fear that is not
@@ -1198,10 +1198,10 @@ When LITERAL-P is non-nil, the contained text is
literal text."
;; image
;; (?u)^(?P<name>image|unfloat)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$
(list "^\\(image\\)::\\([^ \t\n]*?\\)\\[\\(.*?\\)\\][ \t]*$"
- '(0 '(face markup-delimiter-face adoc-reserved block-del)) ; whole
match
+ '(0 '(face markup-meta-face adoc-reserved block-del)) ; whole match
'(1 markup-complex-replacement-face t) ; macro name
'(2 markup-internal-reference-face t) ; file name
- '(3 '(face markup-delimiter-face
+ '(3 '(face markup-meta-face
adoc-reserved nil
adoc-attribute-list (((0 "alt") markup-secondary-text-face)
("title" markup-secondary-text-face)))
@@ -1325,7 +1325,7 @@ When LITERAL-P is non-nil, the contained text is literal
text."
;; ^\[(?P<attrlist>.*)\]$
(list "^\\(\\[\\(.*\\)\\]\\)[ \t]*$"
'(1 '(face markup-meta-face adoc-reserved block-del))
- '(2 '(face markup-delimiter-face adoc-attribute-list t)))
+ '(2 '(face markup-meta-face adoc-attribute-list t)))
;; block title
- [nongnu] elpa/adoc-mode 7fdddd54f7 132/199: Require Emacs 26, (continued)
- [nongnu] elpa/adoc-mode 7fdddd54f7 132/199: Require Emacs 26, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode bded623e3d 139/199: [Fix #8] Add a changelog, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 00c59c8d95 145/199: [Fix #7] Convert readme to AsciiDoc (#10), ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 893daa395c 152/199: Move the syntax-table out of the mode definition, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2c4847d843 160/199: Tweak a couple of docstrings, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode c3d738dd7d 169/199: Fix a typo, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 109bdc5d13 180/199: Fix a typo and some whitespace issues, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 9e7af55e7e 183/199: Fix a typo, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b0702bdeb8 187/199: [Fix #33] Address noticeable lag when typing in larger code blocks (#35), ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 526e058665 029/199: added another list item test, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a0ddf0f02d 034/199: added tests for images,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode 1a4e93ec7c 035/199: enhanded general block macro incl. tests, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fcabdc3a7e 037/199: added general inline macro, began reworking anchors, touched image, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 656e7670c5 099/199: fixed type: denote -> demote, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2cfd433622 030/199: extended quotes tests, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a61e7cd749 063/199: added AsciiDoc menu & key map, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 22bd99a194 075/199: test: Use with-temp-buffer instead home-brewed solution, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a3d77b0c15 082/199: bumped copyright year, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a8142043e5 094/199: adoc customization group comment puts more emphasis on that most faces belong to markup-faces, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 1206fe7409 103/199: adoc-re-inline-macro can now also match in the middle of a word, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 0ac95247d4 116/199: refactoring so regexp's for one- and two line titles have group 2 for title's text, ELPA Syncer, 2023/09/03