Repository navigation
test: pin text and font output to its ISO clauses - #755
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pins the text and font output of v2.4 to the ISO clauses it claims, one test per clause. Test and docs only: nothing under
src/changes.ConformanceAuditG2Tests(Kernel.Tests): fonts and ToUnicode inConformanceAuditG2Tests.Fonts.cs, tabs, Preformatted, joined runs and the Layout reports inConformanceAuditG2Tests.Text.cs, readers inConformanceAuditG2Support.cs. Fixtures use only the fonts in the tree: DejaVu Sans, Source Sans 3 Extra Light and the twelve bundled Liberation programs.docs/conformance-v2.4.md: the G2 section, 56 clause rows (35 compliant, 15 gap, 6 not applicable, 0 human-only) and a second table of 6 product pins that no clause requires.VellumPdf.Kernel.Tests.csprojgains a reference toVellumPdf.Fonts.Standard14, which the Liberation tests use.Each test first asserts the construct is in the saved file, then checks the written keys, codes and bytes against the clause, then runs the oracles where a rule exists (veraPDF 2b, 2u, 2a and UA-1 as the fixture claims, qpdf --check, poppler). The tests locate font tables with the library's
SfntFont.Parse, parse one CFF with the library'sCffFont, and take tab positions fromTextStyle.MeasureString. The table contents, the cmap, the hmtx widths and the head box are decoded in the test.veraPDF does not see glyph 0 in an OpenType CFF font: its 6.2.11.8-1 passed a Source Sans 3 file that shows glyph 0 once. A pinned test records it.
Gaps
Ten skipped tests mark requirements the code does not meet. Each skip reason names its issue. Three of the gap issues are new (#752, #753, #754). Eleven rows cite only issues that already exist: the fsType row (#267), the soft line end, Preformatted line end, paragraph line break and 6.7.3.2 rows (#588), the 6.2.11.4.1, Symbol and ZapfDingbats ToUnicode and 7.21.4.1 note 5 rows (#711, #474), the glyph 0 row (#474), the private use row (#602) and the 6.7.3.1 row (#303).
Mutations
Fourteen mutations of
srcwere each run against the whole class. Twelve fail at least one test; the last, which writes the form Table 121 recommends, must pass and does. The mutated source was restored withgit checkout -- srcafter every run.Iso32000_1_9_8_FontBBoxIsTheHeadBoxScaledToAThousandAndRoundedOutwardIso32000_1_9_8_FontBBoxOfALiberationProgramIsItsHeadBoxRoundedOutward(12 cases)Iso32000_1_9_8_ItalicAngleIsNegativeForAFaceThatSlopesToTheRightIssue647_EveryLineOfAToUnicodeCMapEndsWithOneLineFeedIso32000_1_9_8_2_FlagsHoldNoUndefinedBitAndExactlyOneOfSymbolicAndNonsymbolicIso32000_1_9_7_4_2_ASubsetDefinesGlyphZeroAndEveryGlyphItShowsIso32000_1_9_7_4_2_ASubsetDefinesGlyphZeroAndEveryGlyphItShows, plus three oracle and pin testsIssue662_APreformattedBlockExpandsTabsToSpacesAndKeepsEveryOtherSpaceIssue653_ATabIsNeverShownAndALeaderIsAnArtifactPathNotTextGates
Release, REQUIRE_ORACLES=1, veraPDF 1.30.4, qpdf 12.4.2:
VellumPdf.Kernel.Tests: 3579 total, 3544 passed, 35 skipped, 0 failed on net10.0 and on net11.0.ConformanceAuditG2Tests: 261 total, 251 passed, 10 skipped (the gap tests), on both.dotnet format --verify-no-changes,eng/clean-room-check.ps1andeng/generate-roadmap.py --checkpass.Not done