From 2370940c3597a656a445032c9b69511b13dfd476 Mon Sep 17 00:00:00 2001 From: Romain Deltour Date: Sat, 22 Apr 2023 13:09:54 +0200 Subject: [PATCH] test: add a test for a valid MathML altimg ref See also #1492 --- .../content-document-xhtml.feature | 7 ++++++- .../EPUB/content_001.xhtml | 0 .../EPUB/nav.xhtml | 0 .../EPUB/package.opf | 0 .../META-INF/container.xml | 0 .../mimetype | 0 .../EPUB/content_001.xhtml | 19 ++++++++++++++++++ .../EPUB/images/math.jpg | Bin 0 -> 1962 bytes .../EPUB/nav.xhtml | 14 +++++++++++++ .../EPUB/package.opf | 17 ++++++++++++++++ .../META-INF/container.xml | 6 ++++++ .../mimetype | 1 + 12 files changed, 63 insertions(+), 1 deletion(-) rename src/test/resources/epub3/06-content-document/files/{content-xhtml-mathml-altimg-not-found-warning => content-xhtml-mathml-altimg-not-found-error}/EPUB/content_001.xhtml (100%) rename src/test/resources/epub3/06-content-document/files/{content-xhtml-mathml-altimg-not-found-warning => content-xhtml-mathml-altimg-not-found-error}/EPUB/nav.xhtml (100%) rename src/test/resources/epub3/06-content-document/files/{content-xhtml-mathml-altimg-not-found-warning => content-xhtml-mathml-altimg-not-found-error}/EPUB/package.opf (100%) rename src/test/resources/epub3/06-content-document/files/{content-xhtml-mathml-altimg-not-found-warning => content-xhtml-mathml-altimg-not-found-error}/META-INF/container.xml (100%) rename src/test/resources/epub3/06-content-document/files/{content-xhtml-mathml-altimg-not-found-warning => content-xhtml-mathml-altimg-not-found-error}/mimetype (100%) create mode 100644 src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/content_001.xhtml create mode 100644 src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/images/math.jpg create mode 100644 src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/nav.xhtml create mode 100644 src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/package.opf create mode 100644 src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/META-INF/container.xml create mode 100644 src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/mimetype diff --git a/src/test/resources/epub3/06-content-document/content-document-xhtml.feature b/src/test/resources/epub3/06-content-document/content-document-xhtml.feature index 28769d1d5..3a392e4e2 100644 --- a/src/test/resources/epub3/06-content-document/content-document-xhtml.feature +++ b/src/test/resources/epub3/06-content-document/content-document-xhtml.feature @@ -425,9 +425,14 @@ Feature: EPUB 3 — Content Documents — XHTML #### MathML + @spec @xref:sec-manifest-elem + Scenario: Allow a MathML formula with an alternative image + When checking EPUB 'content-xhtml-mathml-altimg-valid' + Then no other errors or warnings are reported + @spec @xref:sec-manifest-elem Scenario: Report a MathML formula with an alternative image that cannot be found - When checking EPUB 'content-xhtml-mathml-altimg-not-found-warning' + When checking EPUB 'content-xhtml-mathml-altimg-not-found-error' Then error RSC-007 is reported And no other errors or warnings are reported diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/EPUB/content_001.xhtml b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/EPUB/content_001.xhtml similarity index 100% rename from src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/EPUB/content_001.xhtml rename to src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/EPUB/content_001.xhtml diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/EPUB/nav.xhtml b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/EPUB/nav.xhtml similarity index 100% rename from src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/EPUB/nav.xhtml rename to src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/EPUB/nav.xhtml diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/EPUB/package.opf b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/EPUB/package.opf similarity index 100% rename from src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/EPUB/package.opf rename to src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/EPUB/package.opf diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/META-INF/container.xml b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/META-INF/container.xml similarity index 100% rename from src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/META-INF/container.xml rename to src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/META-INF/container.xml diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/mimetype b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/mimetype similarity index 100% rename from src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-warning/mimetype rename to src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-not-found-error/mimetype diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/content_001.xhtml b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/content_001.xhtml new file mode 100644 index 000000000..fe78664fa --- /dev/null +++ b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/content_001.xhtml @@ -0,0 +1,19 @@ + + + + + Minimal EPUB + + +

Loomings

+

Call me Ishmael.

+ + + 10 + × + 10 + + + + diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/images/math.jpg b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/images/math.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ff336a51f6dead6a18ee333037587f44c8f1c62f GIT binary patch literal 1962 zcmZ9NX;jh)7smgrBBim55Q!@iBBDT6Clzx+6Bk^{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Jw~6o(6(f8sVDpk4bGgqFDGpasKR^GXlQ`8u5gbOPe_|IF?$H>K5vF4z4wLg02WpBS_gA+vUEyvE5w~)Y$ zXTpHJnV1a`0geUa9Z)qgw94xO8mAe(&XUksm7a9Q<|Jv|>4Qz2T83|~$lZ-vRHBNi zHO0J|7Cb^#^tn!>_jW%>yVT(Bjq<%6g4Q<9=Q1^e?rL(s*X%Y37`Cr=hR26nV`)utL%uobOB7^$qHB}aA$!C^JY)I1PPAlGcpy9}* z05V3ItIL{IZMR+2PLZu?ck%M}K}lWslUB}5T&UGv11C3F!iMtX=e2*`1(s`Ke8?$F$qkT$p3 tR2BM$*=lqAV;Ul(=0!E9u8+;$x3y;KABX3?E(G-`f~o|lN(5wO?Em1hBGLc= literal 0 HcmV?d00001 diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/nav.xhtml b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/nav.xhtml new file mode 100644 index 000000000..240745e63 --- /dev/null +++ b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/nav.xhtml @@ -0,0 +1,14 @@ + + + + + Minimal Nav + + + + + diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/package.opf b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/package.opf new file mode 100644 index 000000000..c7339ab25 --- /dev/null +++ b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/EPUB/package.opf @@ -0,0 +1,17 @@ + + + + Minimal EPUB 3.0 + en + NOID + 2017-06-14T00:00:01Z + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/META-INF/container.xml b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/META-INF/container.xml new file mode 100644 index 000000000..318782179 --- /dev/null +++ b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/META-INF/container.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/mimetype b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/mimetype new file mode 100644 index 000000000..57ef03f24 --- /dev/null +++ b/src/test/resources/epub3/06-content-document/files/content-xhtml-mathml-altimg-valid/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file