Repository navigation
test(conformance): add blind cases around U+0000 and control characters - #65
Merged
Merged
Conversation
Adds 17 cases for the questions #63 settled around U+0000, and for the unquoted attribute value of CommonMark 0.31.2 section 6.6. They were written from SPEC.md at 5fda73e by an author who had not seen the implementation, and are added here byte for byte as written. - resolve/: a U+0000 in a heading is in no slug (section 8.2). - anchor/record/: a raw U+0000 in an anchor line, and a leaf.text spelling \u0000, are REFUSED(record-inconsistent); a raw U+FFFD in the anchor line resolves (section 11.1). - anchor/suggestion/: write-back over a U+0000 inside the span, in a paragraph and in a heading (section 11.7). - anchor/transclusion/: a raw U+0000 in a pin line refuses the transclusion; a raw U+FFFD pin and a destination holding U+0000 both resolve (sections 3, 11.9). - refusal/link-reference-definition/: bare and angle destinations holding U+0000 are refused, with U+0001 and unclosed-angle controls. - refusal/raw-html/: an unquoted attribute value holding U+0001, U+001F or plain letters is refused, with a control whose value holds `"`. Two cases of the same set are not added: their names are already taken by different cases on main (anchor/suggestion/writes-back-keeping-a-u0000-outside-the-span and anchor/suggestion/writes-back-in-a-heading-keeping-a-u0000-outside-the- span), and adding them would overwrite those. The author recorded these questions SPEC.md does not decide, and wrote no case for them: 1. A pin whose path spells \u0000 matches no transclusion (section 3), but what the transclusion with no pin, and the pin with no transclusion, then resolve to is open (section 12). 2. Write-back with a span at a heading content's edge: section 11.7's list of raw characters no content code point comes from does not name a heading's `#` runs and the spaces around them. The heading cases keep the span in the middle of the content. 3. The cases README does not say whether a non-ASCII fixture file name or {{blob:PATH}} path is supported. Three transclusion cases use a target named p, U+FFFD, .md. Refs #62 Refs #64 Signed-off-by: Cameron Brooks <95648474+CameronBrooks11@users.noreply.github.com>
CommonMark 0.31.2 section 6.6: "An unquoted attribute value is a nonempty string of characters not including spaces, tabs, line endings, `"`, `'`, `=`, `<`, `>`, or `` ` ``." The reader's pattern excluded every code point from U+0000 to U+0020, so a line such as `<a b=x` U+0001 `y>` was read as a paragraph where CommonMark makes it a type 7 HTML block, which the profile refuses as raw-html. The value now excludes exactly space, tab, line feed, carriage return and the six characters the section names. U+0000 never reaches the pattern: SPEC.md section 3 replaces it with U+FFFD first. The cases refusal/raw-html/refuses-an-unquoted-attribute-value-holding- u0001 and -u001f fail without this change and pass with it. Closes #64 Signed-off-by: Cameron Brooks <95648474+CameronBrooks11@users.noreply.github.com>
The tree now holds 525 cases (check_tree.py: "525 cases: 165 accept, 82 refuse, 278 anchor"). Refs #62 Signed-off-by: Cameron Brooks <95648474+CameronBrooks11@users.noreply.github.com>
Names the two other files every WHY.md of the set lists as read (kindkit case-tree/CASE-TREE.md and CommonMark 0.31.2 spec.txt). Says that non-ASCII fixture names are a question this README leaves open, not one SPEC.md does, and that three cases use one and pass the runner, where the paragraph said no case did. Refs #62 Signed-off-by: Cameron Brooks <95648474+CameronBrooks11@users.noreply.github.com>
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.
Adds 17 conformance cases for the questions #63 settled around U+0000, and for CommonMark 0.31.2 §6.6's unquoted attribute value. They were written from SPEC.md at 5fda73e by an author who had not seen the implementation, and land byte for byte as written (sha256 of every file checked after copying). Two of them failed against the reference. That is #64, fixed here in its own commit.
Commits
test(conformance): add blind cases around U+0000 and control characters: the cases alone.fix(reference): allow control characters in an unquoted attribute value: closes reference: unquoted attribute value refuses control characters CommonMark allows #64.test(conformance): raise the case floor to 525:MIN_CASES508 → 525.docs(conformance): record the provenance of the U+0000 cases: the README provenance paragraph, as earlier sets have.Every case, and its outcome against the reference
"Before" is the reference at 5fda73e, unchanged. "After" is with commit 2.
resolve/a-u0000-in-a-heading-is-in-no-sluganchor/record/refused-for-a-raw-u0000-in-the-anchor-lineanchor/record/refused-for-an-escaped-u0000-in-leaf-textanchor/record/resolves-with-a-raw-ufffd-in-the-anchor-lineanchor/suggestion/writes-back-over-a-u0000-inside-the-spananchor/suggestion/writes-back-in-a-heading-over-a-u0000-inside-the-spananchor/transclusion/refused-for-a-raw-u0000-in-its-pin-lineanchor/transclusion/resolves-with-a-raw-ufffd-in-its-pin-lineanchor/transclusion/resolves-a-destination-holding-a-u0000refusal/link-reference-definition/accepts-a-bare-destination-holding-a-u0001refusal/link-reference-definition/accepts-an-unclosed-angle-destination-holding-a-u0000refusal/link-reference-definition/refuses-a-bare-destination-holding-a-u0000refusal/link-reference-definition/refuses-an-angle-destination-holding-a-u0000refusal/raw-html/accepts-a-double-quote-in-an-unquoted-attribute-valuerefusal/raw-html/refuses-an-unquoted-attribute-value-holding-u0001refusal/raw-html/refuses-an-unquoted-attribute-value-holding-u001frefusal/raw-html/refuses-an-unquoted-attribute-value-of-plain-lettersThe three transclusion cases name their target file
p, U+FFFD,.md, and use that name in a{{blob:PATH}}placeholder. The author asked whether the runner takes a non-ASCII file name. It does: all three pass, so the runner needs no change.Two cases not added
The set has 19 cases. Two of them use names that cases already on
mainhave, with different contents:anchor/suggestion/writes-back-keeping-a-u0000-outside-the-spananchor/suggestion/writes-back-in-a-heading-keeping-a-u0000-outside-the-spanThe ones on
maincame from #42's set. They use other fixtures, record ids and spans ([42, 51]on main against[9, 11]here). Copying the new cases byte for byte would overwrite them, and the tree's rule is add, do not edit. So these two are left out. Run unchanged from a separate directory under other names, both pass the reference with and without commit 2, so leaving them out hides no finding. No other case in the set depends on them. If they should land, they need new directory names, and the owner should decide that, since the name is part of a case.The reference fix (#64)
reference/blockspec/document.py's unquoted attribute value was[^"'=<>\x00-\x20]+. §6.6: "An unquoted attribute value is a nonempty string of characters not including spaces, tabs, line endings,",',=,<,>, or ````." It is now[^ \t\n\r"'=<>]+`. A sweep of `<a b=x` + c + `y>` over U+0001 to U+0020, U+007F and U+FFFD gives `raw-html` for every c except U+000A and U+000D. Those two end the line, so the tag is incomplete there. A space or tab ends the value, and `y` is then a second attribute, so the tag is still complete. pandoc 3.1.11.1 (`-f commonmark`) reads ``, `` and `` as raw HTML blocks too.Gates
Each run on its own, exit code checked directly:
just mutantsat 5fda73e gives the same totals, so nothing survived before for these cases to kill. The heading write-back mutant (U+0000 unmapped in a heading's write-back) was already killed onmain, by the existing heading case. The new cases add kills to mutants that were already dead:U+0000 unmapped in write-backgoes from 2 cases to 4,U+0000 unmapped in a heading's write-backfrom 1 to 2, andbroken pins ignoredfrom 9 to 10.Questions the author recorded, with no case
pathspells\u0000matches no transclusion (§3). What the transclusion with no pin, and the pin with no transclusion, then resolve to is open (§12).#runs or the spaces around them. The heading cases keep the span in the middle of the content.Refs #62