Repository navigation
test(diff): compare a Word-authored clause control edited in place (#1143) - #1159
Merged
Merged
Conversation
…1143) The in-place diff inside an unchanged block content control was covered by hand-built XML only; the one real fixture in the file (HC022) exercises the whole-replacement rule for a table of contents, and no pair in the frozen comparison corpus carries a block control. Adds TestFiles/Issue1143: a pair derived from the Word-authored DB006-Source1.docx by wrapping a heading, a prose paragraph, the seven-row table and a prose paragraph in one rich-text control, with one word changed inside the control in the revised copy (README has the derivation). The test goes through the DocxCompare front door and checks that the control is kept once, that the redline marks exactly that word, that GetRevisions reports only it, that accept and reject reproduce the inputs block for block, and that the redline adds no Office 2019 validation error. With CanDiffInPlace forced to false the test fails on two copies of the control.
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.
Follow-up to #1148 for #1143.
Why
#1148 made a comparison diff the blocks inside an unchanged content control instead of replacing the whole control. Every test of that behaviour used hand-built XML. The one real Word document in the test file (
HC022-Table-Of-Contents.docx) exercises the opposite rule, the whole replacement a table of contents still gets, and none of the 92 pairs in the frozen comparison corpus underTestFiles/WCcontains a block content control. So no Word-authored document ever went through the new path in the suite.What this adds
A comparison pair under
TestFiles/Issue1143, with a README describing the derivation:TestFiles/DB006-Source1.docx, a Word-authored article already in the repository, by one edit toword/document.xml; the other 16 parts are byte-identical to the source and the entry order is unchanged.w:proofErrpair and aw:lastRenderedPageBreak) in one rich-text block control.One test in
BlockWrapperNestedDiffTestscompares the pair through theDocxComparefront door and checks that the control is kept once with no range markers, that the deleted and inserted text are exactly those two words, thatGetRevisionsreports only them, that accept and reject reproduce the revised and original documents block for block (properties, text and run formatting), and that the redline adds no Office 2019 validation error. The source document and both fixtures validate with zero errors.Validation
IrSdtBlock.CanDiffInPlaceforced tofalse, the test fails on two copies of the control; with the shipped code it passes..docxunderTestFiles.Adversarial review
One round on the diff. It checked that the fixture is a genuine Word package rather than a rebuilt one (only
word/document.xmldiffers from the source, and the control sits at body level between untouched paragraphs), that the pair is schema-valid before the comparison so the no-new-errors check is not masking anything, and that the test fails without the feature. No findings needed a change.