Skip to content

Commit

Permalink
test: add test for path-absolute URL strings in package document
Browse files Browse the repository at this point in the history
Closes #1252
  • Loading branch information
rdeltour committed Nov 27, 2022
1 parent fdabe66 commit 5d56717
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8"/>
<title>Minimal EPUB</title>
</head>
<body>
<h1>Loomings</h1>
<p>Call me Ishmael.</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en" lang="en">
<head>
<meta charset="utf-8"/>
<title>Minimal Nav</title>
</head>
<body>
<nav epub:type="toc">
<ol>
<li><a href="content_001.xhtml">content 001</a></li>
</ol>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="q">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title id="title">Minimal EPUB 3.0</dc:title>
<dc:language>en</dc:language>
<dc:identifier id="q">NOID</dc:identifier>
<meta property="dcterms:modified">2017-06-14T00:00:01Z</meta>
</metadata>
<manifest>
<item id="content_001" href="/EPUB/content_001.xhtml" media-type="application/xhtml+xml"/>
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
</manifest>
<spine>
<itemref idref="content_001" />
</spine>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
<rootfiles>
<rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
</rootfiles>
</container>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
application/epub+zip
8 changes: 7 additions & 1 deletion src/test/resources/epub3/04-ocf/ocf.feature
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ Feature: EPUB 3 — Open Container Format
@spec @xref:sec-container-iri
Scenario: Report leaking URLs in the package document
When checking EPUB 'ocf-url-leaking-in-opf-error'
And error RSC-026 is reported 2 times
Then error RSC-026 is reported 2 times
And no other errors or warnings are reported

@spec @xref:sec-container-iri
Scenario: Report path-absolute URLs in the package document
When checking EPUB 'ocf-url-path-absolute-error'
Then error RSC-026 is reported
And no other errors or warnings are reported


Expand Down

0 comments on commit 5d56717

Please sign in to comment.