-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds tests for volume breaking between blocks or words
One of the tests demonstrates a bug, namely that allowsEndingVolumeOnHyphen(false) does not work when a volume-transition element is present. See brailleapps/dotify.formatter.impl#46.
Showing
5 changed files
with
267 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
...aisy/dotify/formatter/test/resource-files/dp2/volume-breaking-between-blocks-expected.pef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<pef xmlns="http://www.daisy.org/ns/2008/pef" version="2008-1"> | ||
<head> | ||
<meta> | ||
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">volume-breaking-between-blocks</dc:title> | ||
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1/">Tests volume-transition element, which modifies the last sheet so that volume breaks occur between blocks.</dc:description> | ||
<dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">application/x-pef+xml</dc:format> | ||
</meta> | ||
</head> | ||
<body> | ||
<volume cols="10" rows="5" rowgap="0" duplex="true"> | ||
<section> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
</page> | ||
<page> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
</page> | ||
<page> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
</volume> | ||
<volume cols="10" rows="5" rowgap="0" duplex="true"> | ||
<section> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
</page> | ||
<page> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
</page> | ||
<page> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
<row>⠤⠤⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
</volume> | ||
<volume cols="10" rows="5" rowgap="0" duplex="true"> | ||
<section> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
</page> | ||
</section> | ||
</volume> | ||
</body> | ||
</pef> |
37 changes: 37 additions & 0 deletions
37
.../daisy/dotify/formatter/test/resource-files/dp2/volume-breaking-between-blocks-input.obfl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<obfl xmlns="http://www.daisy.org/ns/2011/obfl" version="2011-1" xml:lang="und" hyphenate="false"> | ||
<meta> | ||
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">volume-breaking-between-blocks</dc:title> | ||
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1/">Tests volume-transition element, which modifies the last sheet so that volume breaks occur between blocks.</dc:description> | ||
</meta> | ||
<layout-master name="main" duplex="true" page-number-variable="page" page-width="10" page-height="5"> | ||
<default-template> | ||
<header/> | ||
<footer/> | ||
</default-template> | ||
</layout-master> | ||
<volume-template sheets-in-volume-max="3"/> | ||
<volume-transition range="sheet"/> | ||
<sequence master="main"> | ||
<block>⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
</block> | ||
<block>⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ | ||
⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ | ||
⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ | ||
</block> | ||
<block>⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
</block> | ||
<block>⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ | ||
⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ | ||
⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ ⠤⠤⠤⠤⠤ | ||
</block> | ||
<block>⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ ⠿⠿⠿⠿⠿ | ||
</block> | ||
</sequence> | ||
</obfl> |
69 changes: 69 additions & 0 deletions
69
...daisy/dotify/formatter/test/resource-files/dp2/volume-breaking-between-words-expected.pef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<pef xmlns="http://www.daisy.org/ns/2008/pef" version="2008-1"> | ||
<head> | ||
<meta> | ||
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">volume-breaking-between-words</dc:title> | ||
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1/">Tests allowsEndingVolumeOnHyphen(false) when a volume-transition element is present. The test passes if the volume-transition element is removed from the OBFL.</dc:description> | ||
<dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">application/x-pef+xml</dc:format> | ||
</meta> | ||
</head> | ||
<body> | ||
<volume cols="10" rows="5" rowgap="0" duplex="true"> | ||
<section> | ||
<page> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁⠀⠿⠿⠤</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁⠀⠿⠿⠤</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁⠀⠿⠿⠤</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
</page> | ||
</section> | ||
</volume> | ||
<volume cols="10" rows="5" rowgap="0" duplex="true"> | ||
<section> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿⠿⠿</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁⠀⠿⠿⠤</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁⠀⠿⠿⠤</row> | ||
</page> | ||
<page> | ||
<row>⠿⠿⠿⠿⠿</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁</row> | ||
<row>⠁⠁⠁⠁⠁⠀⠿⠿</row> | ||
</page> | ||
</section> | ||
</volume> | ||
</body> | ||
</pef> |
26 changes: 26 additions & 0 deletions
26
...g/daisy/dotify/formatter/test/resource-files/dp2/volume-breaking-between-words-input.obfl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<obfl xmlns="http://www.daisy.org/ns/2011/obfl" version="2011-1" xml:lang="und" hyphenate="false"> | ||
<meta> | ||
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">volume-breaking-between-words</dc:title> | ||
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1/">Tests allowsEndingVolumeOnHyphen(false) when a volume-transition element is present. The test passes if the volume-transition element is removed from the OBFL.</dc:description> | ||
</meta> | ||
<layout-master name="main" duplex="true" page-number-variable="page" page-width="10" page-height="5"> | ||
<default-template> | ||
<header/> | ||
<footer/> | ||
</default-template> | ||
</layout-master> | ||
<volume-template sheets-in-volume-max="3"/> | ||
<volume-transition range="sheet"/> | ||
<sequence master="main"> | ||
<block>⠁⠁⠁⠁⠁ | ||
⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠿⠿⠿⠿⠿⠿⠿ | ||
⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠿⠿⠿⠿⠿⠿⠿ | ||
⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠿⠿⠿⠿⠿⠿⠿ | ||
⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠿⠿⠿⠿⠿⠿⠿ | ||
⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠿⠿⠿⠿⠿⠿⠿ | ||
⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠿⠿⠿⠿⠿⠿⠿ | ||
⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠁⠁⠁⠁⠁ ⠿⠿ | ||
</block> | ||
</sequence> | ||
</obfl> |