Repository navigation
Commit 42fff5b
committed
Port PeachPDF's PDF-pipeline end-to-end tests (Batch 5, final)
Ports PeachPDF.Tests/Integration/{FixedPositionPaginationIntegrationTests,
HandleLinksPaginationTests,TableHeaderPdfRenderingTests,
TableHeaderRepetitionThroughTheGeneratorTests}.cs into
Source/Test/HtmlRenderer.PdfSharp.Test/, adapted to this project's own
established pattern (MultiPageTextVisibilityTest/FixedPositionRepeatsPerPdfPageTest):
real PdfGenerator.GeneratePdf output, content-level assertions against the raw
PDF content stream, not page-count-only checks.
FixedPositionPaginationIntegrationTests (1/1 port, rewritten): PeachPDF's fixture
used page-break-before to land a fixed box's background on 3 real pages - this
fork has no page-break-before/after at all (already documented by
FixedPositionRepeatsPerPageTest), so real multi-page output is forced with
filler content instead, the same way the two existing fixed-position tests in
this branch's history already do it. Not redundant with either of them:
FixedPositionRepeatsPerPageTest asserts the fragment tree directly, never a
real PDF; FixedPositionRepeatsPerPdfPageTest goes through the real generator
but only counts Tj text operators, never a fixed box's own background fill
(a different draw path, GraphicsAdapter.DrawRectangle) nor that it repeats at
the same page-local position on every page. This test fills that specific gap.
HandleLinksPaginationTests (2/2 port): link-annotation page attribution through
the real generator. This fork's own PdfGenerator.HandleLinks was already
rewritten (pre-dating this batch) to build a slotToPage map from
tree.Fragmentainers and match each link against every fragmentainer's own
Geometry band, so PeachPDF's two historical bugs here (unshifted MarginTop in
the page-index formula; raw grid-slot used directly as a Pages index) don't
reproduce - both tests are real regression pins of that already-correct
behavior, not bug repros, verified through the real document.Pages[i].Annotations
rather than assumed. page-break-before dropped for the same reason as above;
both fixtures use genuine filler-driven pagination instead.
TableHeaderPdfRenderingTests (4/5 ported, 1 dropped, 1 rewritten): this fork
implements no <tfoot> repeat at all (TableHeaderRepeat.cs is thead-only), so
TableFooter_MultiPageTable_GeneratesWithFooter is dropped outright, and
TableHeaderAndFooter_SinglePageTable_PaintsEachCellTextExactlyOnce (which used
PeachPDF's own mock DrawStringRecordingGraphics paint harness, not a real PDF)
is rewritten as a header-only, real-PDF, content-stream regression pin instead
(TableHeader_SinglePageTable_PaintsHeaderBackgroundExactlyOnce). All 4 surviving
tests were upgraded past PeachPDF's own page-count/non-empty-stream checks
(explicitly insufficient per this branch's own MultiPageTextVisibilityTest
history) to confirm the header's background fill actually repeats on every real
generated page, via a content-stream fill-operator pattern confirmed empirically
against a real dump during porting.
TableHeaderRepetitionThroughTheGeneratorTests (adapted down to 2 tests): dropped
tfoot assertions and the @page-driven fixture (confirmed parse-only, no
consumer anywhere) in favor of PdfGenerateConfig's own PageSize/margins, and
replaced FragmentTree assertions with real content-stream checks - this project
has no InternalsVisibleTo access to HtmlContainerInt (only HtmlRenderer.Test/
HtmlRenderer.IntegrationTest do). Porting PeachPDF's exact fixture shape (one
row, one very tall continuing cell, no trailing row) surfaced that it lands
squarely in an already-documented gap: TableSpannedBandRepetitionTests (Batch 4)
pins that the header-repeat loop only re-checks for a band transition at the
start of a NEXT row's own iteration, so a lone continuing row with nothing
after it never gets the header repeated past its own starting page. Confirmed
empirically here through the full real PdfGenerator pipeline (not just
LayoutHarness) and pinned as such, extending Batch 4's coverage of the same gap
rather than reshaping the fixture to dodge it or silently asserting the wrong
thing as correct.
No new production bugs found this batch - HandleLinks and the header-repeat
loop's documented limitation were both already correct/already pinned by
earlier stages of this branch.
Full suite after this batch: HtmlRenderer.Test 2427/128/0 (unchanged),
HtmlRenderer.IntegrationTest 323/101/0 (unchanged), HtmlRenderer.PdfSharp.Test
39/0/0 (was 30/0/0 - +9 new tests). Solution build clean across net8.0/
netstandard2.0/net462 with only the 1 known pre-existing CS8602 warning.
This is the final batch of the 5-batch PeachPDF fragmentation test port.1 parent ea99b55 commit 42fff5b
4 files changed
Lines changed: 495 additions & 0 deletions
File tree
- Source/Test/HtmlRenderer.PdfSharp.Test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
0 commit comments