From 54b673494c6cddc705d6a45e5a76b822f1688751 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Mon, 5 Oct 2026 15:07:39 +1100 Subject: [PATCH] Move to the paged document support in Verify 33.3 --- readme.md | 111 ++++++++++++++++-- src/Directory.Build.props | 2 +- src/Directory.Packages.props | 6 +- src/StaticSettingsTests/ModuleInitializer.cs | 10 +- .../OutputsTests.PdfWithoutPng.verified.txt | 3 + src/Tests/Ghostscript.cs | 6 +- ...les.PasswordSample#page_0001.verified.png} | Bin ...les.PasswordSample#page_0002.verified.png} | Bin ...asswordSamples.PasswordSample.verified.txt | 3 + ...Samples.ExcludeDerivedTargets.verified.pdf | Bin 0 -> 2715 bytes ...Samples.ExcludeDerivedTargets.verified.txt | 3 + ...les.PagesToInclude#page_0001.verified.png} | Bin src/Tests/Samples.PagesToInclude.verified.pdf | Bin 0 -> 2715 bytes src/Tests/Samples.PagesToInclude.verified.txt | 3 + ...amples.PdfPassword#page_0001.verified.png} | Bin ...amples.PdfPassword#page_0002.verified.png} | Bin src/Tests/Samples.PdfPassword.verified.txt | 3 + ... Samples.VerifyPdf#page_0001.verified.png} | Bin ... Samples.VerifyPdf#page_0002.verified.png} | Bin src/Tests/Samples.VerifyPdf.verified.txt | 3 + ...les.VerifyPdfStream#page_0001.verified.png | Bin 0 -> 14647 bytes ...es.VerifyPdfStream#page_0002.verified.png} | Bin .../Samples.VerifyPdfStream.verified.txt | 3 + src/Tests/Samples.cs | 18 +++ ...heNeutralizedBytes#page_0001.verified.png} | Bin ...heNeutralizedBytes#page_0002.verified.png} | Bin ...pshotHoldsTheNeutralizedBytes.verified.txt | 3 + ...dsTheProducerBytes#page_0001.verified.png} | Bin ...dsTheProducerBytes#page_0002.verified.png} | Bin ...SnapshotHoldsTheProducerBytes.verified.txt | 3 + ...sts.PagesToInclude#page_0002.verified.png} | Bin src/Tests/Tests.PagesToInclude.verified.pdf | Bin 0 -> 2715 bytes src/Tests/Tests.PagesToInclude.verified.txt | 3 + ...ipPdfNormalization#page_0001.verified.png} | Bin ...ipPdfNormalization#page_0002.verified.png} | Bin .../Tests.SkipPdfNormalization.verified.txt | 3 + ...=> Tests.VerifyPdf#page_0001.verified.png} | Bin ...=> Tests.VerifyPdf#page_0002.verified.png} | Bin src/Tests/Tests.VerifyPdf.verified.txt | 3 + ...fyPdfWithName#name.page_0001.verified.png} | Bin ...ifyPdfWithName#name.page_0002.verified.png | Bin 0 -> 9465 bytes .../Tests.VerifyPdfWithName#name.verified.txt | 3 + .../Tests.VerifySvgWithName#name.verified.png | Bin 0 -> 664 bytes .../Tests.VerifySvgWithName#name.verified.svg | 23 ++++ src/Tests/Tests.cs | 10 ++ ...entNone_format=pdf#page_0001.verified.png} | Bin ...es.TransparentNone_format=pdf.verified.txt | 3 + ...ckgroundColor=Blue#page_0001.verified.png} | Bin ...rmat=pdf_backgroundColor=Blue.verified.txt | 3 + ...kgroundColor=Green#page_0001.verified.png} | Bin ...mat=pdf_backgroundColor=Green.verified.txt | 3 + ...dColor=Transparent#page_0001.verified.png} | Bin ...f_backgroundColor=Transparent.verified.txt | 3 + src/Verify.ImageMagick/GlobalUsings.cs | 1 - src/Verify.ImageMagick/ImageMagickOutputs.cs | 23 ---- src/Verify.ImageMagick/ImageMagickSettings.cs | 21 ---- src/Verify.ImageMagick/VerifyImageMagick.cs | 11 +- .../VerifyImageMagick_Pdf.cs | 43 ++++--- .../VerifyImageMagick_Svg.cs | 21 ++-- 59 files changed, 253 insertions(+), 104 deletions(-) create mode 100644 src/StaticSettingsTests/OutputsTests.PdfWithoutPng.verified.txt rename src/Tests/{PasswordSamples.PasswordSample#00.verified.png => PasswordSamples.PasswordSample#page_0001.verified.png} (100%) rename src/Tests/{PasswordSamples.PasswordSample#01.verified.png => PasswordSamples.PasswordSample#page_0002.verified.png} (100%) create mode 100644 src/Tests/PasswordSamples.PasswordSample.verified.txt create mode 100644 src/Tests/Samples.ExcludeDerivedTargets.verified.pdf create mode 100644 src/Tests/Samples.ExcludeDerivedTargets.verified.txt rename src/Tests/{Samples.VerifyPdf#00.verified.png => Samples.PagesToInclude#page_0001.verified.png} (100%) create mode 100644 src/Tests/Samples.PagesToInclude.verified.pdf create mode 100644 src/Tests/Samples.PagesToInclude.verified.txt rename src/Tests/{Samples.PdfPassword#00.verified.png => Samples.PdfPassword#page_0001.verified.png} (100%) rename src/Tests/{Samples.PdfPassword#01.verified.png => Samples.PdfPassword#page_0002.verified.png} (100%) create mode 100644 src/Tests/Samples.PdfPassword.verified.txt rename src/Tests/{Samples.VerifyPdfStream#00.verified.png => Samples.VerifyPdf#page_0001.verified.png} (100%) rename src/Tests/{Samples.VerifyPdf#01.verified.png => Samples.VerifyPdf#page_0002.verified.png} (100%) create mode 100644 src/Tests/Samples.VerifyPdf.verified.txt create mode 100644 src/Tests/Samples.VerifyPdfStream#page_0001.verified.png rename src/Tests/{Samples.VerifyPdfStream#01.verified.png => Samples.VerifyPdfStream#page_0002.verified.png} (100%) create mode 100644 src/Tests/Samples.VerifyPdfStream.verified.txt rename src/Tests/{SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#00.verified.png => SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#page_0001.verified.png} (100%) rename src/Tests/{SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#01.verified.png => SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#page_0002.verified.png} (100%) create mode 100644 src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes.verified.txt rename src/Tests/{SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#00.verified.png => SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#page_0001.verified.png} (100%) rename src/Tests/{SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#01.verified.png => SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#page_0002.verified.png} (100%) create mode 100644 src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes.verified.txt rename src/Tests/{Tests.SkipPdfNormalization#01.verified.png => Tests.PagesToInclude#page_0002.verified.png} (100%) create mode 100644 src/Tests/Tests.PagesToInclude.verified.pdf create mode 100644 src/Tests/Tests.PagesToInclude.verified.txt rename src/Tests/{Tests.SkipPdfNormalization#00.verified.png => Tests.SkipPdfNormalization#page_0001.verified.png} (100%) rename src/Tests/{Tests.VerifyPdf#01.verified.png => Tests.SkipPdfNormalization#page_0002.verified.png} (100%) create mode 100644 src/Tests/Tests.SkipPdfNormalization.verified.txt rename src/Tests/{Tests.VerifyPdf#00.verified.png => Tests.VerifyPdf#page_0001.verified.png} (100%) rename src/Tests/{Tests.VerifyPdfWithName#name.01.verified.png => Tests.VerifyPdf#page_0002.verified.png} (100%) create mode 100644 src/Tests/Tests.VerifyPdf.verified.txt rename src/Tests/{Tests.VerifyPdfWithName#name.00.verified.png => Tests.VerifyPdfWithName#name.page_0001.verified.png} (100%) create mode 100644 src/Tests/Tests.VerifyPdfWithName#name.page_0002.verified.png create mode 100644 src/Tests/Tests.VerifyPdfWithName#name.verified.txt create mode 100644 src/Tests/Tests.VerifySvgWithName#name.verified.png create mode 100644 src/Tests/Tests.VerifySvgWithName#name.verified.svg rename src/Tests/{TransparentSamples.TransparentNone_format=pdf.verified.png => TransparentSamples.TransparentNone_format=pdf#page_0001.verified.png} (100%) create mode 100644 src/Tests/TransparentSamples.TransparentNone_format=pdf.verified.txt rename src/Tests/{TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue.verified.png => TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue#page_0001.verified.png} (100%) create mode 100644 src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue.verified.txt rename src/Tests/{TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green.verified.png => TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green#page_0001.verified.png} (100%) create mode 100644 src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green.verified.txt rename src/Tests/{TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent.verified.png => TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent#page_0001.verified.png} (100%) create mode 100644 src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent.verified.txt delete mode 100644 src/Verify.ImageMagick/ImageMagickOutputs.cs diff --git a/readme.md b/readme.md index 4b14568..ba2b4ef 100644 --- a/readme.md +++ b/readme.md @@ -10,6 +10,16 @@ Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of Converts documents pdfs to png for verification. +Verifying a `pdf` produces: + + * The pdf itself as `.verified.pdf`. This can be omitted with [`ExcludeTargets`](#choosing-what-is-verified). + * A `.verified.txt` with the page count. + * A png render of every page as `#page_0001.verified.png`, `#page_0002.verified.png`, etc. + +Verifying an `svg` produces the svg as `.verified.svg` and a png render of it as `.verified.png`. + +The page files are named by Verify's [paged documents](https://github.com/VerifyTests/Verify/blob/main/docs/paged-documents.md) support, which every Verify plugin that splits a document into pages shares. So do the settings that [choose what is verified](#choosing-what-is-verified). + Contains [comparers](https://github.com/VerifyTests/Verify/blob/master/docs/comparer.md) for png, jpg, bmp, and tiff. @@ -50,25 +60,55 @@ public static void Init() `Initialize` registers the pdf to png converter and all comparers. -### Outputs +### Choosing what is verified -`Initialize` accepts an optional `ImageMagickOutputs` flags enum that controls, globally, which outputs a document is split into: +What a pdf or an svg is split into is controlled by Verify's settings for [paged documents](https://github.com/VerifyTests/Verify/blob/main/docs/paged-documents.md), which replace the options this plugin had of its own. - * `Png`: render pdf pages and svg documents to png. - * `None`: none of the above. Only the source document is emitted. - * `All`: all of the above. This is the default. +`PagesToInclude` limits the pages of a pdf that are verified, to its first pages or to those a delegate accepts. The pdf itself is still verified whole, and the info file still holds the number of pages it has: -Omitted outputs are skipped before any rendering, so no work is done for them. The source document target (pdf or svg) is always emitted; use `VerifierSettings.ExcludeTargets("pdf")` to exclude it. Png, webp, and tiff image files are not affected. To emit only the source document, pass `ImageMagickOutputs.None`: + + +```cs +[Test] +public Task PagesToInclude() => + VerifyFile("sample.pdf") + .PagesToInclude(1); +``` +snippet source | anchor + + +`ExcludeDerivedTargets("png")` leaves out the png renders, keeping the pdf or the svg. The render is skipped rather than dropped afterwards. The pages of a pdf are then only counted, so its info file still says how many there are: + + + +```cs +[Test] +public Task ExcludeDerivedTargets() => + VerifyFile("sample.pdf") + .ExcludeDerivedTargets("png"); +``` +snippet source | anchor + + +It applies to a png rendered from a pdf or an svg. A png, webp or tiff that is itself being verified is not affected. + +`ExcludeTargets("pdf")` leaves out the pdf, keeping its pages and its info file. A [password-protected pdf](#open-password-protected-pdfs) requires it. + +Each can also be set for every test, on `VerifierSettings`: ```cs [ModuleInitializer] -public static void Init() => - // Only emit the source document. Skip rendering to png. - VerifyImageMagick.Initialize(ImageMagickOutputs.None); +public static void Init() +{ + VerifyImageMagick.Initialize(); + + // For every test: no png, so only the source document is verified + VerifierSettings.ExcludeDerivedTargets("png"); +} ``` -snippet source | anchor +snippet source | anchor @@ -112,9 +152,21 @@ public Task VerifyPdfStream() #### Result -[Samples.VerifyPdf#00.verified.png](/src/Tests/Samples.VerifyPdf#00.verified.png): +[Samples.VerifyPdf.verified.txt](/src/Tests/Samples.VerifyPdf.verified.txt): + + + +```txt +{ + PageCount: 2 +} +``` +snippet source | anchor + - +[Samples.VerifyPdf#page_0001.verified.png](/src/Tests/Samples.VerifyPdf%23page_0001.verified.png): + + ### Image Comparers @@ -174,6 +226,41 @@ public Task PdfPassword() => snippet source | anchor + +## Reviewing changes + +A change to a pdf is a change to several files: the pdf, its info file, and every page. Verify tells the diff tool that the pages and the info file were derived from the pdf, and [DiffEngineViewer](https://github.com/VerifyTests/DiffEngine/blob/main/docs/viewer.md#files-derived-from-a-document), which draws a pdf's pages itself, shows them as one row and accepts them together. Other diff tools are given each file, as before. The png of an svg is derived from the svg in the same way. + +When the pdf or the svg has itself changed, what was derived from it is compared exactly, skipping any [comparer](#image-comparers) registered for png. ImageMagick writes the time into every png it renders, so every page of a changed pdf is then reported as changed, whether or not it draws differently. + + +## Migrating from 3.x + +Version 4 moves to the paged document support in Verify 33.3. The options of this plugin that chose what was verified are now settings of Verify: + +| 3.x | 4.x | +| --- | --- | +| `Initialize(ImageMagickOutputs.None)` | `Initialize()` and `VerifierSettings.ExcludeDerivedTargets("png")` | +| `Initialize(ImageMagickOutputs.Png)` or `Initialize(ImageMagickOutputs.All)` | `Initialize()` | +| `.PagesToInclude(2)`, an extension method of this plugin | `.PagesToInclude(2)`, a member of Verify's `SettingsTask` and `VerifySettings` | + +A call to `PagesToInclude` compiles unchanged. It can now also take a delegate, and both it and `ExcludeDerivedTargets` can be set for one verification or, on `VerifierSettings`, for all of them. + +The page of a pdf is named by its number, which is 1 based. It was named by an index, which was 0 based and missing for a pdf with one page. A pdf also has an info file now, holding its page count: + +| 3.x | 4.x | +| --- | --- | +| `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`, of a pdf with one page | `Tests.Report#page_0001.verified.png` | +| `Tests.Mail#Attachment.00.verified.png`, of a pdf that is a target named `Attachment` | `Tests.Mail#Attachment.page_0001.verified.png` | +| | `Tests.Report.verified.txt`, the info file | + +The `.verified.pdf` is unchanged, and so are the `.verified.svg` and `.verified.png` of an svg. + +Renamed snapshots show as a new file and a pending delete. Accepting both, or running once with [AutoVerify](https://github.com/VerifyTests/Verify/blob/main/docs/autoverify.md), moves a test over. A page draws as it did, but ImageMagick writes the time into every png it renders, so an accepted page differs from the file it replaces by those bytes, and source control shows a rename with a small change. + + ## Icon [Swirl](https://thenounproject.com/term/wizard/2744075/) designed by [Philipp Petzka](https://thenounproject.com/masteroficon) from [The Noun Project](https://thenounproject.com/). diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 62c2fbe..2c1be63 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ CS1591 - 3.11.0 + 4.0.0 1.0.0 enable preview diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index bd64149..529d794 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -12,10 +12,10 @@ - - + + - + diff --git a/src/StaticSettingsTests/ModuleInitializer.cs b/src/StaticSettingsTests/ModuleInitializer.cs index dd0f665..124b2f1 100644 --- a/src/StaticSettingsTests/ModuleInitializer.cs +++ b/src/StaticSettingsTests/ModuleInitializer.cs @@ -3,9 +3,13 @@ public static class ModuleInitializer #region InitializeOutputs [ModuleInitializer] - public static void Init() => - // Only emit the source document. Skip rendering to png. - VerifyImageMagick.Initialize(ImageMagickOutputs.None); + public static void Init() + { + VerifyImageMagick.Initialize(); + + // For every test: no png, so only the source document is verified + VerifierSettings.ExcludeDerivedTargets("png"); + } #endregion } diff --git a/src/StaticSettingsTests/OutputsTests.PdfWithoutPng.verified.txt b/src/StaticSettingsTests/OutputsTests.PdfWithoutPng.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/StaticSettingsTests/OutputsTests.PdfWithoutPng.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Ghostscript.cs b/src/Tests/Ghostscript.cs index 2595272..0487f08 100644 --- a/src/Tests/Ghostscript.cs +++ b/src/Tests/Ghostscript.cs @@ -5,13 +5,13 @@ static class Ghostscript // Replaces the pdf converter registered by Initialize with one that treats that as inconclusive, // so pdf tests do not fail on machines that do not have Ghostscript installed. public static void RegisterPdfConverter() => - VerifierSettings.RegisterStreamConverter("pdf", Convert); + VerifierSettings.RegisterStreamConverter("pdf", (_, stream, context) => Convert(stream, context)); - static ConversionResult Convert(string? name, Stream stream, IReadOnlyDictionary context) + static ConversionResult Convert(Stream stream, IReadOnlyDictionary context) { try { - return VerifyImageMagick.Convert(name, stream, context, MagickFormat.Pdf); + return VerifyImageMagick.Convert(stream, context, MagickFormat.Pdf); } catch (MagickDelegateErrorException exception) when (exception.Message.Contains("(127)")) diff --git a/src/Tests/PasswordSamples.PasswordSample#00.verified.png b/src/Tests/PasswordSamples.PasswordSample#page_0001.verified.png similarity index 100% rename from src/Tests/PasswordSamples.PasswordSample#00.verified.png rename to src/Tests/PasswordSamples.PasswordSample#page_0001.verified.png diff --git a/src/Tests/PasswordSamples.PasswordSample#01.verified.png b/src/Tests/PasswordSamples.PasswordSample#page_0002.verified.png similarity index 100% rename from src/Tests/PasswordSamples.PasswordSample#01.verified.png rename to src/Tests/PasswordSamples.PasswordSample#page_0002.verified.png diff --git a/src/Tests/PasswordSamples.PasswordSample.verified.txt b/src/Tests/PasswordSamples.PasswordSample.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/PasswordSamples.PasswordSample.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Samples.ExcludeDerivedTargets.verified.pdf b/src/Tests/Samples.ExcludeDerivedTargets.verified.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b6cdb4cc332d72a9b4fb5c4b04d34a0729c299fc GIT binary patch literal 2715 zcmbtW2~ZPP7#>@-H8qxMQK^D!6a|I7l8_KdR0yaoK@AiYyq4?>tR%Z}cY!3-8MSy- z8AY_}jE<$Fj@Hq!h&o3mIt&Prx(@T3oNeGup$JT57UjvPYE(K!Br_85 zo5uo2F_1YML!|OHf#vvoViL!X<|QsLHkkr((W;u`rg07#h(wx$k%1XNM?ja7RcO3JRekk5I zW#Yo4%HQ3WAJ$HEdvch~bq&2w;@!VKSy9ZIAN(*@YB=>w8$RDUBx70L_V^!%GP&0@ zF`w5*-1j!h`JoJX*!f8FGgG^Lw6B85vANNrD4mm>WG$9<>u=41vGBRwTZ@%yGfZWMjsLLm!hVNLE z%vDYI))Zcf`y_Qx@vYh^saG$mq8FWB@!NCzG1sA{=_{L}jsxXtpK(*CzIS>~X)LYS zG$w)?dv;0PvVp_D@b#E+;9yVwBUi&wQ)>gWX2)n`;|*-)+`H<85Y{H zMC2Uw)dzi{{;)+hAjVinn=zN&SNu0#uu>x6k83>}Jqy!fk*2UU!o8XLv8V49z zXmMyZZ~||JdJ$tbkgcwqSi&N(ZJgbEC8L!j~&X`5_G52%n{Pq#2EX{6i5*b0G+ z<$-*TH>!LGkEk$?HL50QEu_Vj0t&dXUJ+z^GqP;nLR%uM8fj7_xeaco%L%)Kxt$JP zGPsQ@2Ffciz-MG8RG1$k7aCP&56_^+Xkc4t9j?>Ig?5I8vvxsrN~k$17+PfQ1}lWW z4h%;|RY)UC)VLt#6BIm)1W6M#9S;%ll82WWcRVi*3Pdmi$tH3x8MYNe5t%%pNH(fe zif*st!rf?z%S*VwcvJxaCkP5x6D>%%(0@m|85cy7t&kSW+p$h3fhvSa3<2Vp{v&ac zP-#IgxCc&`!Otat*kMAfiTB@GBne3b@0=u}4JgD*5VHiq5y&2bY@T=x4e+Rg6s=&* zp74cf_jKeJ1o^!z7K2%^6*=LD!Z@>kNv#gUn+E>sTl)sWWdl)yB!JPV04it-fUNLU z!Xd7tI2cJXvB1t0IphGo&8#AcK#U4u7~E063DOolwj2&PXgOXmgHct24o|xmm|FyP zC5cg_GPpi0L9113F}osQqM*>B3*!SON)O*BtxdEJeulI*C1~53^mJPjMJ2QiPtomB zw7#9AhK9=1oKY4T&H+U94VcM!0bCGa6$BYWN^2#?@pb`2!U-SExk-MfxBQqoMj$bl TWJZ+z4W!k2oiaK)b$r@CD3F>K literal 0 HcmV?d00001 diff --git a/src/Tests/Samples.ExcludeDerivedTargets.verified.txt b/src/Tests/Samples.ExcludeDerivedTargets.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Samples.ExcludeDerivedTargets.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Samples.VerifyPdf#00.verified.png b/src/Tests/Samples.PagesToInclude#page_0001.verified.png similarity index 100% rename from src/Tests/Samples.VerifyPdf#00.verified.png rename to src/Tests/Samples.PagesToInclude#page_0001.verified.png diff --git a/src/Tests/Samples.PagesToInclude.verified.pdf b/src/Tests/Samples.PagesToInclude.verified.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b6cdb4cc332d72a9b4fb5c4b04d34a0729c299fc GIT binary patch literal 2715 zcmbtW2~ZPP7#>@-H8qxMQK^D!6a|I7l8_KdR0yaoK@AiYyq4?>tR%Z}cY!3-8MSy- z8AY_}jE<$Fj@Hq!h&o3mIt&Prx(@T3oNeGup$JT57UjvPYE(K!Br_85 zo5uo2F_1YML!|OHf#vvoViL!X<|QsLHkkr((W;u`rg07#h(wx$k%1XNM?ja7RcO3JRekk5I zW#Yo4%HQ3WAJ$HEdvch~bq&2w;@!VKSy9ZIAN(*@YB=>w8$RDUBx70L_V^!%GP&0@ zF`w5*-1j!h`JoJX*!f8FGgG^Lw6B85vANNrD4mm>WG$9<>u=41vGBRwTZ@%yGfZWMjsLLm!hVNLE z%vDYI))Zcf`y_Qx@vYh^saG$mq8FWB@!NCzG1sA{=_{L}jsxXtpK(*CzIS>~X)LYS zG$w)?dv;0PvVp_D@b#E+;9yVwBUi&wQ)>gWX2)n`;|*-)+`H<85Y{H zMC2Uw)dzi{{;)+hAjVinn=zN&SNu0#uu>x6k83>}Jqy!fk*2UU!o8XLv8V49z zXmMyZZ~||JdJ$tbkgcwqSi&N(ZJgbEC8L!j~&X`5_G52%n{Pq#2EX{6i5*b0G+ z<$-*TH>!LGkEk$?HL50QEu_Vj0t&dXUJ+z^GqP;nLR%uM8fj7_xeaco%L%)Kxt$JP zGPsQ@2Ffciz-MG8RG1$k7aCP&56_^+Xkc4t9j?>Ig?5I8vvxsrN~k$17+PfQ1}lWW z4h%;|RY)UC)VLt#6BIm)1W6M#9S;%ll82WWcRVi*3Pdmi$tH3x8MYNe5t%%pNH(fe zif*st!rf?z%S*VwcvJxaCkP5x6D>%%(0@m|85cy7t&kSW+p$h3fhvSa3<2Vp{v&ac zP-#IgxCc&`!Otat*kMAfiTB@GBne3b@0=u}4JgD*5VHiq5y&2bY@T=x4e+Rg6s=&* zp74cf_jKeJ1o^!z7K2%^6*=LD!Z@>kNv#gUn+E>sTl)sWWdl)yB!JPV04it-fUNLU z!Xd7tI2cJXvB1t0IphGo&8#AcK#U4u7~E063DOolwj2&PXgOXmgHct24o|xmm|FyP zC5cg_GPpi0L9113F}osQqM*>B3*!SON)O*BtxdEJeulI*C1~53^mJPjMJ2QiPtomB zw7#9AhK9=1oKY4T&H+U94VcM!0bCGa6$BYWN^2#?@pb`2!U-SExk-MfxBQqoMj$bl TWJZ+z4W!k2oiaK)b$r@CD3F>K literal 0 HcmV?d00001 diff --git a/src/Tests/Samples.PagesToInclude.verified.txt b/src/Tests/Samples.PagesToInclude.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Samples.PagesToInclude.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Samples.PdfPassword#00.verified.png b/src/Tests/Samples.PdfPassword#page_0001.verified.png similarity index 100% rename from src/Tests/Samples.PdfPassword#00.verified.png rename to src/Tests/Samples.PdfPassword#page_0001.verified.png diff --git a/src/Tests/Samples.PdfPassword#01.verified.png b/src/Tests/Samples.PdfPassword#page_0002.verified.png similarity index 100% rename from src/Tests/Samples.PdfPassword#01.verified.png rename to src/Tests/Samples.PdfPassword#page_0002.verified.png diff --git a/src/Tests/Samples.PdfPassword.verified.txt b/src/Tests/Samples.PdfPassword.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Samples.PdfPassword.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Samples.VerifyPdfStream#00.verified.png b/src/Tests/Samples.VerifyPdf#page_0001.verified.png similarity index 100% rename from src/Tests/Samples.VerifyPdfStream#00.verified.png rename to src/Tests/Samples.VerifyPdf#page_0001.verified.png diff --git a/src/Tests/Samples.VerifyPdf#01.verified.png b/src/Tests/Samples.VerifyPdf#page_0002.verified.png similarity index 100% rename from src/Tests/Samples.VerifyPdf#01.verified.png rename to src/Tests/Samples.VerifyPdf#page_0002.verified.png diff --git a/src/Tests/Samples.VerifyPdf.verified.txt b/src/Tests/Samples.VerifyPdf.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Samples.VerifyPdf.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Samples.VerifyPdfStream#page_0001.verified.png b/src/Tests/Samples.VerifyPdfStream#page_0001.verified.png new file mode 100644 index 0000000000000000000000000000000000000000..f6ae65e1f017731b1045a5112386998ad8a9a6d2 GIT binary patch literal 14647 zcmeHudt8#))<4aqX1aN1DjhSmCezBimv?2#DKj8Yz@zhTK%g{R5NQ4^2;_PL1Tsh}Zwqh-UVQR{ulM&L-Q|M8F5vFVq@!ohz%}aQ zPp{-D7x=R#)yMzvn)$V>3@pC*KIw;V0iyGnL8ns#Be2_(Qcy8*3DMhAGm@gWrza+X zK+bvBPx*dLv|Z0tZ}#}{YSfqcGiS3V%B-_iJf}A9DU4#-+MV@7=x(3V7 zr)g910S3{ybN0XAx$Wcc)DZS_e3rXO-WO`(uTrxavrAQ*bDtE#($+l;b=+;wk;Uc%Q0$c-Qg$i7O9!w}Z|${=Uh=HgNct z)!JW{oYB*$R~rt25?1|qB+p=a<;lsYC&x|?fF4&=Z7*b;vCK9`w1{svYLs z%=M0i4QCI0{&MZ(E#D8G*>TndY0;BxyD_An8;-lA``OEA@36^>C`dQ&w+J(aLrOun z!SgN1o-el=@8{gXoY=FwRrkrp*eH;GFX_S+2cpS?oF$9h=G}W1>0e~Nyt7l`%8Ic% z{A-ZssjKpb70EaK(g{a4o}ojHtX@==JZ&m_w3W8S5UW_sYd!JJX&Tx0=#RwYo>#08 ze;RaoZJLw*@>j<^GeAU1hz@+da{o5RZHJot(@w*z^M6~Uud5@EX->a9_(K%Sc!Pnr z=aY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16AhO9xa+s`pSw zpRF<;tY#@g2*0wx@eI>OfC9%en3aH|l0?!(pUD z{KeaH%pe<6e2`eN)cQ=C=b~{$M6_2`i)j-ou4XV*HF2&8^CFnJ5(>;bSy6SDpk#rQ zJ_;rN;P)q*GYP=}rhLAOVUTShBLiq-aGZJgEoI%9VJv5tfzZCsOELn5#p9`?Fq6gm zm|CX1zvILJjW+0&$tWeo`X+`w(*{z=@EqPLb|qeOHxjC-uK8?+gt>Cr|_j0=;K%asA7jmTu$m@SqzkR}<49@`a? z@$8iO8PlEdQ;OlpNqF;(7q^0o>-s;KU}Oj|7Jd)9-%PJ;UyU`)-mf&gbp1#*b!vV& zAVXR?$li(s2S^hT4MlwK^=WMMgjak$#I1la0L^Z6ER~TMp5MeN)L9hQBSD!NlN517 z_;jN7#aVltBGs{0U2;Xxd<{t=z+LC!jiXQF3EiiUkVSopmGNJd zRC$VywY`G_CMh_aWyuUWJy#Z;Q6LNai5h+IycxSLqCI$s<_Up2Gd3rs75FN{x%0>`+wL~U;-)NnnzQA`|G6J zf8v3@f5Wf;nsokk^6@|NfahQ9;jaU~|AFV4|62BcE&IQg{r};Kx4%BE_z(PoM6Ltv a?;Y7Pyd(ZQ;L{$E&*9_WHy%3s<9`7aVQdZn literal 0 HcmV?d00001 diff --git a/src/Tests/Samples.VerifyPdfStream#01.verified.png b/src/Tests/Samples.VerifyPdfStream#page_0002.verified.png similarity index 100% rename from src/Tests/Samples.VerifyPdfStream#01.verified.png rename to src/Tests/Samples.VerifyPdfStream#page_0002.verified.png diff --git a/src/Tests/Samples.VerifyPdfStream.verified.txt b/src/Tests/Samples.VerifyPdfStream.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Samples.VerifyPdfStream.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Samples.cs b/src/Tests/Samples.cs index bbe8d92..d3be37b 100644 --- a/src/Tests/Samples.cs +++ b/src/Tests/Samples.cs @@ -48,6 +48,24 @@ public Task VerifyPdfStream() #endregion + #region PagesToInclude + + [Test] + public Task PagesToInclude() => + VerifyFile("sample.pdf") + .PagesToInclude(1); + + #endregion + + #region ExcludeDerivedTargets + + [Test] + public Task ExcludeDerivedTargets() => + VerifyFile("sample.pdf") + .ExcludeDerivedTargets("png"); + + #endregion + [Test] public Task VerifySvg() => VerifyFile(ProjectFiles.sample_svg.Path); diff --git a/src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#00.verified.png b/src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#page_0001.verified.png similarity index 100% rename from src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#00.verified.png rename to src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#page_0001.verified.png diff --git a/src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#01.verified.png b/src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#page_0002.verified.png similarity index 100% rename from src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#01.verified.png rename to src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes#page_0002.verified.png diff --git a/src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes.verified.txt b/src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/SkipPdfNormalizationTests.NormalizedSnapshotHoldsTheNeutralizedBytes.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#00.verified.png b/src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#page_0001.verified.png similarity index 100% rename from src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#00.verified.png rename to src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#page_0001.verified.png diff --git a/src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#01.verified.png b/src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#page_0002.verified.png similarity index 100% rename from src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#01.verified.png rename to src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes#page_0002.verified.png diff --git a/src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes.verified.txt b/src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/SkipPdfNormalizationTests.SkippedSnapshotHoldsTheProducerBytes.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Tests.SkipPdfNormalization#01.verified.png b/src/Tests/Tests.PagesToInclude#page_0002.verified.png similarity index 100% rename from src/Tests/Tests.SkipPdfNormalization#01.verified.png rename to src/Tests/Tests.PagesToInclude#page_0002.verified.png diff --git a/src/Tests/Tests.PagesToInclude.verified.pdf b/src/Tests/Tests.PagesToInclude.verified.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b6cdb4cc332d72a9b4fb5c4b04d34a0729c299fc GIT binary patch literal 2715 zcmbtW2~ZPP7#>@-H8qxMQK^D!6a|I7l8_KdR0yaoK@AiYyq4?>tR%Z}cY!3-8MSy- z8AY_}jE<$Fj@Hq!h&o3mIt&Prx(@T3oNeGup$JT57UjvPYE(K!Br_85 zo5uo2F_1YML!|OHf#vvoViL!X<|QsLHkkr((W;u`rg07#h(wx$k%1XNM?ja7RcO3JRekk5I zW#Yo4%HQ3WAJ$HEdvch~b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Tests/Tests.PagesToInclude.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Tests.PagesToInclude.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Tests.SkipPdfNormalization#00.verified.png b/src/Tests/Tests.SkipPdfNormalization#page_0001.verified.png similarity index 100% rename from src/Tests/Tests.SkipPdfNormalization#00.verified.png rename to src/Tests/Tests.SkipPdfNormalization#page_0001.verified.png diff --git a/src/Tests/Tests.VerifyPdf#01.verified.png b/src/Tests/Tests.SkipPdfNormalization#page_0002.verified.png similarity index 100% rename from src/Tests/Tests.VerifyPdf#01.verified.png rename to src/Tests/Tests.SkipPdfNormalization#page_0002.verified.png diff --git a/src/Tests/Tests.SkipPdfNormalization.verified.txt b/src/Tests/Tests.SkipPdfNormalization.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Tests.SkipPdfNormalization.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Tests.VerifyPdf#00.verified.png b/src/Tests/Tests.VerifyPdf#page_0001.verified.png similarity index 100% rename from src/Tests/Tests.VerifyPdf#00.verified.png rename to src/Tests/Tests.VerifyPdf#page_0001.verified.png diff --git a/src/Tests/Tests.VerifyPdfWithName#name.01.verified.png b/src/Tests/Tests.VerifyPdf#page_0002.verified.png similarity index 100% rename from src/Tests/Tests.VerifyPdfWithName#name.01.verified.png rename to src/Tests/Tests.VerifyPdf#page_0002.verified.png diff --git a/src/Tests/Tests.VerifyPdf.verified.txt b/src/Tests/Tests.VerifyPdf.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Tests.VerifyPdf.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Tests.VerifyPdfWithName#name.00.verified.png b/src/Tests/Tests.VerifyPdfWithName#name.page_0001.verified.png similarity index 100% rename from src/Tests/Tests.VerifyPdfWithName#name.00.verified.png rename to src/Tests/Tests.VerifyPdfWithName#name.page_0001.verified.png diff --git a/src/Tests/Tests.VerifyPdfWithName#name.page_0002.verified.png b/src/Tests/Tests.VerifyPdfWithName#name.page_0002.verified.png new file mode 100644 index 0000000000000000000000000000000000000000..f3ff39e6acb229856f682e4f3c6b277b8c8412ed GIT binary patch literal 9465 zcmeHMYgkh0+NOi!)KtziQ|muAwZyYx^4ZLPuJ_tIQn7U>zZ8=ClOvCQ2Krl=*o8> zkWzQ*$|MMc1A{=43m_2eE(m0paIe+ZS=X`l+tVIyAZ<>;YnJY4L&C{`WL+Ei$7WFU zLa5u(Px16}*OzQuW4PP#_~MH)9qCHCpMMG>9KS0eDIOhjDQZ^=At7p48a4q0a>%=b zJiV0!-Xv6g<#O#-^vPgSIwvc2NH-kM)UgJj_(|Gs`P^7n9BIbv@fX{8Rgd$BKl_U#trYL45Va zqnBGNlYSxp{@94t(D6NIJ?h=2`)IWXvf>EiBFMLs{}-wk?JTAJI2Ike6GZI^9&p&LkV@0#8Fh3T81f33Ly z(R;h`**3S=0lP0a##wYGg14Z46^0VO*Zy$a_%FR?eUUyLqWj@{*|tdq9frSci|gEA zWNJ55nR@o%foAR6Ezyyn?Oo)nKiZPa>arIt4(#tZIN$bZ`rFDqOE5m#(*35NEAp27 zNoiuqnY7C%wgj{V8C&+17rm(e>8Vl6ww?H;`Ml<{JN#Q{r%zrZC3cSRQC=-U%8fYt z?aD7sxe`F68I%@&rOeI*YI3aJ3+EqVm4AP}?XxP{fZG4<(QhO9rkf2tT%VWTJ7|Vn zyux3){izl+hn`)#t(Tj=8=WZINmvh$KYtaBS`3od91WC! zKG}%qy;?qD-n!c6=drTWgOEAO|e8dlI1B2M=6c4=9fjITQhv4;x;{Or; z7krnm4i5YK5WKu#Zt)Q~Y*bu|ryB@|i;09m(YBFj8(SO8@bDv1mbNzGM=Txf933np zZ6S70TXZDEA>8rc&8?}rC?@}mf{4<|pQ4lI_@(gV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EI<`>*pk-_&UKqEUdgI zj-qy|<2q3!X>D$1EIFTv`UWP0=gdVXT**(IR>W5+F3jhG4C6fH)++yqy1wwGZ z6OlZp&P6m4370+`C)zIYDjMQnvsv(3Ps?&(fL+gIf^u;PE>1hIRHSZf)YhNFHT>zD#9DQl`gs?Gn8bRA}`jDw1+&7gbdfN zFR~t%*?atks=@ei&^SbQ;FfcQ%z=S^8%DHpL01gyJeQ94<*)%I5W@9B_DJ8o+DeeL zQs`+>fCUoA<7!=N7ovG^qU-CvVzw`7z`aJ&B|UgutvP-R(?th3ODuth!Oalv6LTbz z?&}3$0!SUrVZ+%3#i#sA8o+M`il&>rB_d`urrz{i28_ZcwH5fgsL~tCDoVJkD_djA zOE`ocemm>-f*2MQAJHgo#fUYFkDm2^Fs<4ogww8Fefx5mt;$VR&=Ywese5p&)G389Hc61_w3{i5!t{Q zAM6wS8JZQ<@We{zK}Ib*)-jVm{%{;g^zDY3b~;~%8X!@)K{mH((0&wJHHU7(uxiKh zZCpPHfMWM0=1E(OEo>xsVfw78e0D2lL6IW_~NC{rI*erme;|Pf`h3Nt=aS zUA0_U*f>?(F_ae@Do;5R?|)u(VkPC2wRJIXwUU&&dchAap?G0}yR%#m-xyE80h@_o90?^Mfd#sh46f4X1?w-PWwQ-L=um}WqT^lJM6#)ivu^u z!)Po(sCp%++)tm%5Fs&zMx1Z!b0Zj}v8+=%MDdJzGF4vWBF6^WGw3m#>mH@&42wYY;Z0tghicAIb-gRF`z8+lL+jF#xMi+OR$B(_=pSpCAE9y8L`KA*yI_NshT}j zTx>-nZc56yIQz~r`jeOKtD6@tG=2YI@CyVV}MaP7YU?w&zC literal 0 HcmV?d00001 diff --git a/src/Tests/Tests.VerifyPdfWithName#name.verified.txt b/src/Tests/Tests.VerifyPdfWithName#name.verified.txt new file mode 100644 index 0000000..02e2bb9 --- /dev/null +++ b/src/Tests/Tests.VerifyPdfWithName#name.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 2 +} \ No newline at end of file diff --git a/src/Tests/Tests.VerifySvgWithName#name.verified.png b/src/Tests/Tests.VerifySvgWithName#name.verified.png new file mode 100644 index 0000000000000000000000000000000000000000..21e6b7bcbc248fe9e60465e2bbd6c31e0a3a210f GIT binary patch literal 664 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=3?wxlRx|@Cg=CK)Uj~LMH3o);76yi2K%s^g z3=E|P3=FRl7#OT(FffQ0%-I!a1C*!;@CkAK4+O7X{r~sx|APnr6%_ubr~hYQ_<#TY z|FpFKw{QQKk@7=xCjB=v`#*W|{|_JjPnq)H-2DI4ssAl4|Nr?T z$8mNh&<%`9-tI089jvk*Kn`btM`SUOP5|Q%*-qzy4E7RFUsv{5T#VxKoGLHg`2&Si zOI#yLQW8s2t&)pUffR$0fsvW6p@FV}VTh5jm9e3ffu**Aft7&)S6!JFiiX_$l+3hB z+#0Ht&rJhr(16=el9`)YT#}eufLo7_*?Ui*o+q9zjv*e$r(Su^cgTQ;<$=S)8%y5^ zy4`&Lzs+Te;H;;+_g_=LIW2W5Q>KaN%r#fle6KNCTsCYnp31N*>9b(b<=4z}BqNw4 zxXvW76fD!bbWHTvlQkXE`x%Z|Y9Ct0(KSI+jUoLJ(~M_p3Vfrk^tvz@pFZPy$Smli zanVP^o)u?m4svWZUph^@Z;fxV^r@Wq$HH#!?|F;OUT=_go@?R7_WhehX3P?ha98Pd zSLv~2%!@a$BVy|TzO!S3}J%{Nv^d+p)T h?Af{5X{GyyPb^>RG_I#jS_?{p44$rjF6*2UngH>r2c`f3 literal 0 HcmV?d00001 diff --git a/src/Tests/Tests.VerifySvgWithName#name.verified.svg b/src/Tests/Tests.VerifySvgWithName#name.verified.svg new file mode 100644 index 0000000..275b97d --- /dev/null +++ b/src/Tests/Tests.VerifySvgWithName#name.verified.svg @@ -0,0 +1,23 @@ + + + + + + + diff --git a/src/Tests/Tests.cs b/src/Tests/Tests.cs index cc27cc7..fc4ca52 100644 --- a/src/Tests/Tests.cs +++ b/src/Tests/Tests.cs @@ -176,4 +176,14 @@ public Task SkipPdfNormalization() => [Test] public Task VerifyPdfWithName() => Verify(targets: [new("pdf", ProjectFiles.sample_pdf.OpenRead(), "name")]); + + [Test] + public Task VerifySvgWithName() => + Verify(targets: [new("svg", ProjectFiles.transparent_svg.OpenRead(), "name")]); + + // A page keeps its number when the pages before it are left out, so this is #page_0002. + [Test] + public Task PagesToInclude() => + VerifyFile(ProjectFiles.sample_pdf.Path) + .PagesToInclude(_ => _ == 2); } \ No newline at end of file diff --git a/src/Tests/TransparentSamples.TransparentNone_format=pdf.verified.png b/src/Tests/TransparentSamples.TransparentNone_format=pdf#page_0001.verified.png similarity index 100% rename from src/Tests/TransparentSamples.TransparentNone_format=pdf.verified.png rename to src/Tests/TransparentSamples.TransparentNone_format=pdf#page_0001.verified.png diff --git a/src/Tests/TransparentSamples.TransparentNone_format=pdf.verified.txt b/src/Tests/TransparentSamples.TransparentNone_format=pdf.verified.txt new file mode 100644 index 0000000..17e6e49 --- /dev/null +++ b/src/Tests/TransparentSamples.TransparentNone_format=pdf.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 1 +} \ No newline at end of file diff --git a/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue.verified.png b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue#page_0001.verified.png similarity index 100% rename from src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue.verified.png rename to src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue#page_0001.verified.png diff --git a/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue.verified.txt b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue.verified.txt new file mode 100644 index 0000000..17e6e49 --- /dev/null +++ b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Blue.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 1 +} \ No newline at end of file diff --git a/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green.verified.png b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green#page_0001.verified.png similarity index 100% rename from src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green.verified.png rename to src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green#page_0001.verified.png diff --git a/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green.verified.txt b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green.verified.txt new file mode 100644 index 0000000..17e6e49 --- /dev/null +++ b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Green.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 1 +} \ No newline at end of file diff --git a/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent.verified.png b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent#page_0001.verified.png similarity index 100% rename from src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent.verified.png rename to src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent#page_0001.verified.png diff --git a/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent.verified.txt b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent.verified.txt new file mode 100644 index 0000000..17e6e49 --- /dev/null +++ b/src/Tests/TransparentSamples.TransparentSample_format=pdf_backgroundColor=Transparent.verified.txt @@ -0,0 +1,3 @@ +{ + PageCount: 1 +} \ No newline at end of file diff --git a/src/Verify.ImageMagick/GlobalUsings.cs b/src/Verify.ImageMagick/GlobalUsings.cs index 6c12e9e..78bd6aa 100644 --- a/src/Verify.ImageMagick/GlobalUsings.cs +++ b/src/Verify.ImageMagick/GlobalUsings.cs @@ -1,5 +1,4 @@ global using DeterministicPdf; -global using System.Diagnostics.CodeAnalysis; global using EmptyFiles; global using ImageMagick; global using ImageMagick.Formats; diff --git a/src/Verify.ImageMagick/ImageMagickOutputs.cs b/src/Verify.ImageMagick/ImageMagickOutputs.cs deleted file mode 100644 index b2eb919..0000000 --- a/src/Verify.ImageMagick/ImageMagickOutputs.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace VerifyTests; - -/// -/// Controls which outputs a document (pdf or svg) is split into. -/// -[Flags] -public enum ImageMagickOutputs -{ - /// - /// No outputs. Only the source document is emitted. - /// - None = 0, - - /// - /// Render pdf pages and svg documents to png. - /// - Png = 1, - - /// - /// All outputs. - /// - All = Png -} diff --git a/src/Verify.ImageMagick/ImageMagickSettings.cs b/src/Verify.ImageMagick/ImageMagickSettings.cs index 072dd0e..2e85045 100644 --- a/src/Verify.ImageMagick/ImageMagickSettings.cs +++ b/src/Verify.ImageMagick/ImageMagickSettings.cs @@ -11,27 +11,6 @@ public static void ImageMagickBackground(MagickColor color) => public static void ImageMagickPdfPassword(string password) => pdfPassword = password; - public static void PagesToInclude(this VerifySettings settings, int count) => - settings.Context["ImageMagick.PagesToInclude"] = count; - - public static SettingsTask PagesToInclude(this SettingsTask settings, int count) - { - settings.CurrentSettings.PagesToInclude(count); - return settings; - } - - internal static bool GetPagesToInclude(this IReadOnlyDictionary context, [NotNullWhen(true)] out int? pages) - { - if (context.TryGetValue("ImageMagick.PagesToInclude", out var value)) - { - pages = (int) value; - return true; - } - - pages = null; - return false; - } - public static void MagickReadSettings(this VerifySettings settings, MagickReadSettings magickReadSettings) => settings.Context["ImageMagick.MagickReadSettings"] = magickReadSettings; diff --git a/src/Verify.ImageMagick/VerifyImageMagick.cs b/src/Verify.ImageMagick/VerifyImageMagick.cs index 51c6a07..7a21ba9 100644 --- a/src/Verify.ImageMagick/VerifyImageMagick.cs +++ b/src/Verify.ImageMagick/VerifyImageMagick.cs @@ -4,10 +4,7 @@ public static partial class VerifyImageMagick { public static bool Initialized { get; private set; } - static ImageMagickOutputs outputs = ImageMagickOutputs.All; - - /// Which outputs pdf and svg documents are split into. Defaults to . - public static void Initialize(ImageMagickOutputs outputs = ImageMagickOutputs.All) + public static void Initialize() { if (Initialized) { @@ -15,12 +12,11 @@ public static void Initialize(ImageMagickOutputs outputs = ImageMagickOutputs.Al } Initialized = true; - VerifyImageMagick.outputs = outputs; InnerVerifier.ThrowIfVerifyHasBeenRun(); VerifierSettings.RegisterStreamConverter( "svg", - ConvertSvg); + (_, stream, context) => ConvertSvg(stream, context)); VerifierSettings.RegisterStreamConverter( "png", (name, stream, context) => ConvertImage(name, stream, context, "png", MagickFormat.Png)); @@ -33,6 +29,9 @@ public static void Initialize(ImageMagickOutputs outputs = ImageMagickOutputs.Al RegisterPdfToPngConverter(); } + // The image is the thing being verified, not something derived from a document, so this + // stays on the constructor that leaves the naming to the converter and passes the name on. + // As a derived target it would be dropped by ExcludeDerivedTargets. static ConversionResult ConvertImage(string? name, Stream stream, IReadOnlyDictionary context, string extension, MagickFormat format) { var background = context.Background(); diff --git a/src/Verify.ImageMagick/VerifyImageMagick_Pdf.cs b/src/Verify.ImageMagick/VerifyImageMagick_Pdf.cs index 024c267..89aec53 100644 --- a/src/Verify.ImageMagick/VerifyImageMagick_Pdf.cs +++ b/src/Verify.ImageMagick/VerifyImageMagick_Pdf.cs @@ -7,12 +7,11 @@ public static void RegisterPdfToPngConverter() InnerVerifier.ThrowIfVerifyHasBeenRun(); VerifierSettings.RegisterStreamConverter( "pdf", - (name, stream, context) => Convert(name, stream, context, MagickFormat.Pdf)); + (_, stream, context) => Convert(stream, context, MagickFormat.Pdf)); } - internal static ConversionResult Convert(string? name, Stream stream, IReadOnlyDictionary context, MagickFormat magickFormat) + internal static ConversionResult Convert(Stream stream, IReadOnlyDictionary context, MagickFormat magickFormat) { - var streams = new List(); var magickSettings = context.MagickReadSettings(); magickSettings.Format = magickFormat; var password = context.PdfPassword(); @@ -44,20 +43,21 @@ internal static ConversionResult Convert(string? name, Stream stream, IReadOnlyD // MagickImageCollection has consumed it. stream = WrapStream(stream); - if (outputs.HasFlag(ImageMagickOutputs.Png)) + // Names the pages and says which of them the verification wants, so that is decided the + // same way here as in every other converter of a paged document. + var conversion = new PagedConversion(context); + + // Ghostscript draws every page in the one read, so the read can only be skipped whole: + // when the pngs are excluded. The pages are then only counted, which reads what each + // one is without drawing it, so the info file says how many there are either way. + if (conversion.IncludeImages) { using var images = new MagickImageCollection(); images.Read(stream, magickSettings); - var count = images.Count; - if (context.GetPagesToInclude(out var pagesToInclude)) - { - count = Math.Min(count, (int) pagesToInclude); - } - var background = context.Background(); - for (var index = 0; index < count; index++) + foreach (var number in conversion.Pages(images.Count)) { - var image = images[index]; + var image = images[number - 1]; if (background != null) { image = Flatten(image, background); @@ -65,11 +65,15 @@ internal static ConversionResult Convert(string? name, Stream stream, IReadOnlyD var memoryStream = new MemoryStream(); image.Write(memoryStream, MagickFormat.Png); - streams.Add(memoryStream); + conversion.AddPage(number, memoryStream); } } - - List targets = []; + else + { + using var images = new MagickImageCollection(); + images.Ping(stream, magickSettings); + conversion.PageCount = images.Count; + } // The pdf snapshot is always the full document, regardless of PagesToInclude, which trims // only the rendered pages above. Mirrors the svg target in ConvertSvg, which likewise emits @@ -78,15 +82,10 @@ internal static ConversionResult Convert(string? name, Stream stream, IReadOnlyD { stream.Position = 0; var pdf = context.Normalize() ? PdfNormalizer.Normalize(stream) : CopyRemaining(stream); - targets.Add( - new("pdf", pdf, name, performConversion: false) - { - BypassComparersForSubsequentOnDifference = true - }); + conversion.Source(new("pdf", pdf)); } - targets.AddRange(streams.Select(_ => new Target("png", _, name))); - return new(null, targets); + return conversion.Build(); } // The source stream is consumed elsewhere in this method, so the pdf target gets its own copy. diff --git a/src/Verify.ImageMagick/VerifyImageMagick_Svg.cs b/src/Verify.ImageMagick/VerifyImageMagick_Svg.cs index 696a287..650e848 100644 --- a/src/Verify.ImageMagick/VerifyImageMagick_Svg.cs +++ b/src/Verify.ImageMagick/VerifyImageMagick_Svg.cs @@ -2,12 +2,18 @@ namespace VerifyTests; public static partial class VerifyImageMagick { - static ConversionResult ConvertSvg(string? name, Stream stream, IReadOnlyDictionary context) + static ConversionResult ConvertSvg(Stream stream, IReadOnlyDictionary context) { var content = ReadNormalizedSvg(stream); - if (!outputs.HasFlag(ImageMagickOutputs.Png)) + + // The svg is the source and its render is derived from it, which is what lets + // ExcludeDerivedTargets("png") drop the render and leave a png verified as itself alone. + var source = new Target("svg", content); + + // Asked before rendering, so a png that would be dropped is never drawn. + if (context.IsDerivedTargetExcluded("png")) { - return new(null, [new("svg", content, name)]); + return new(null, source, []); } using var svgStream = new MemoryStream(Encoding.UTF8.GetBytes(content)); @@ -16,12 +22,9 @@ static ConversionResult ConvertSvg(string? name, Stream stream, IReadOnlyDiction var pngStream = new MemoryStream(); svg.Write(pngStream, MagickFormat.Png); - return new( - null, - [ - new("svg", content, name), - new("png", pngStream, name) - ]); + // Not named: an svg has the one render, so it takes the name of the svg and differs from + // it by extension alone. + return new(null, source, [new("png", pngStream)]); } // Verify requires text snapshots to use \n line endings, so an svg authored or checked out