Skip to content

Move to the paged document support in Verify 33.3 - #527

Merged
SimonCropp merged 1 commit into
mainfrom
paged-documents
Oct 5, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
paged-documents

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Moves Verify.DocNet onto the source and derived targets that Verify 33.3 added for paged documents (Verify#1951), and takes the package from 4.0.0 to 5.0.0.

The converter now says which of its targets is the document and which were computed from it. Verify compares the document first, so a file derived from it is only given the benefit of its comparer while the document itself is unchanged, and DiffEngine's viewer shows the files derived from a document beneath it and accepts them with it.

It is a major version because what an existing test suite has to change is listed below. Verify and its adapter are pinned at 33.3.0.

Migrating from 4.x

Version 5 moves to the paged document support in Verify 33.3. The settings and the file names this package had of its own are replaced by the ones every paged document shares.

4.x 5.x
Initialize(DocNetOutputs.Png) VerifierSettings.PageText(PageTextPlacement.None)
Initialize(DocNetOutputs.Text) VerifierSettings.ExcludeDerivedTargets("png")
Initialize(DocNetOutputs.None) Both of the above
.PagesToInclude(2) .PagesToInclude(2). The same call, now a setting of Verify
.SinglePage(0) .PagesToInclude(_ => _ == 1). The index was 0 based, a page number is 1 based

Each of the settings of Verify can be applied to one verification or, on VerifierSettings, to every test.

SinglePage threw for an index past the last page. A PagesToInclude that accepts no page is not an error: no page is rendered or read, and the pdf and the info file are still verified.

The snapshot files are renamed:

4.x 5.x
Tests.Report#pdf.verified.pdf Tests.Report.verified.pdf
Tests.Report#00.verified.png Tests.Report#page_0001.verified.png
Tests.Report#01.verified.png Tests.Report#page_0002.verified.png
Tests.Report.verified.png, where one page was verified Tests.Report#page_0001.verified.png, by the number of that page

The index was 0 based, and was missing where one page was verified. A page is now always named by its 1 based number, which it keeps when other pages are left out.

The content of the pdf and of the page images is unchanged, with one exception: under PagesToInclude or SinglePage the .verified.pdf held only the pages that were rendered, and it is now always the whole document.

Renamed snapshots show as a new file and a pending delete. Accepting both, or running once with AutoVerify, moves a test over. An accepted page image is the one rendered on the machine doing the accepting. Where a comparer has been tolerating a difference in rendering, that image is not byte identical to the committed one, and renaming the files instead leaves them as they are.

The info file keeps its name and has the shape every paged document has: the pdf version under Document, and each page as its Number and its Text.

{                                    {
  Version: 1.4,                        Document: {
  PageCount: 2,                          Version: 1.4
  Pages: [                             },
    {                                  PageCount: 2,
      Text: The first page             Pages: [
    },                                   {
    {                                      Number: 1,
      Index: 1,                            Text: The first page
      Text: The second page              },
    }                                    {
  ]                                        Number: 2,
}                                          Text: The second page
                                         }
                                       ]
                                     }

Testing

Built in Release and run with the commands CI uses, against Verify 33.3.0 from nuget.org: 34 passed, 1 skipped.

@SimonCropp SimonCropp added this to the 5.0.0 milestone Oct 5, 2026
@SimonCropp
SimonCropp merged commit f42feaf into main Oct 5, 2026
7 checks passed
@SimonCropp
SimonCropp deleted the paged-documents branch October 5, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant