name = "quick-xml"
description = "High-performance XML reader and writer — ETNA workload."
language = "rust"
strategies = ["proptest", "quickcheck", "crabcheck", "hegel"]
crate = "quick-xml"
base_commit = "6238d8a16179d68718b43882e544ebd20982c79c"

[[tasks]]
mutations = ["unescape_predef_entities_0315ed0_1"]

[tasks.source]
repo = "https://github.com/tafia/quick-xml"
commits = ["0315ed0a479d3c5b7a1ce8f1bbcde312221e2a2d"]
commit_subjects = ["Fix Attribute::unescape_value does not unescape predefined entities since #739"]
prs = [743]
summary = "After PR #739 reorganised attribute decoding around `normalized_value_with`, the entry-point method `Attribute::normalized_value` was wired to a `|_| None` resolver instead of `resolve_predefined_entity`, so the five XML predefined entity references (`&lt;`, `&gt;`, `&apos;`, `&quot;`) other than `&amp;` were rejected with `EscapeError::UnrecognizedEntity`."

[tasks.injection]
kind = "patch"
patch = "patches/unescape_predef_entities_0315ed0_1.patch"
files = ["src/events/attributes.rs"]
locations = [{ file = "src/events/attributes.rs", line = 86, symbol = "Attribute::normalized_value" }]

[tasks.bug]
short_name = "unescape_predef_entities"
invariant = "`Attribute::normalized_value` must resolve every XML predefined entity reference (`&lt;`, `&gt;`, `&amp;`, `&apos;`, `&quot;`) to its corresponding character, regardless of whether the caller supplied a custom entity resolver."
how_triggered = "The buggy body invokes `self.normalized_value_with(version, 1, |_| None)`. `&amp;` continues to work because `normalize_attr_step` special-cases that name, but `&lt;`, `&gt;`, `&apos;`, and `&quot;` flow through the user resolver, hit the `None` branch, and surface as `EscapeError::UnrecognizedEntity`."

[[tasks.tasks]]
property = "UnescapePredefEntities"
witnesses = [
  { test_fn = "witness_unescape_predef_entities_case_lt" },
  { test_fn = "witness_unescape_predef_entities_case_gt" },
  { test_fn = "witness_unescape_predef_entities_case_combo" },
]

[[tasks]]
mutations = ["swap_lf_cr_escape_codes_ebaffb3_1"]

[tasks.source]
repo = "https://github.com/tafia/quick-xml"
commits = ["ebaffb3db325c4657e5e5df43afa018ee71ce1c5"]
commit_subjects = ["Fix #517: Fix swapped codes for `\\r` and `\\n` characters when escaping them"]
issues = [517]
summary = "The internal `escape_char` writer (used by the xs:list serializer) emitted `&#10;` for `\\r` and `&#13;` for `\\n`, swapping the two character-reference codes; the fix swapped the match arms back to the spec-required mapping."

[tasks.injection]
kind = "patch"
files = ["src/escape.rs"]
locations = [{ file = "src/escape.rs", line = 177, symbol = "escape_char" }]
patch = "patches/swap_lf_cr_escape_codes_ebaffb3_1.patch"

[tasks.bug]
short_name = "swap_lf_cr_escape_codes"
invariant = "`escape::escape_char` must emit the XML character reference `&#10;` for a `\\n` byte (LF, code-point 10) and `&#13;` for a `\\r` byte (CR, code-point 13), matching the canonical numeric values."
how_triggered = "The buggy body swaps the two match arms (`b'\\n' => &#13;` and `b'\\r' => &#10;`), so the byte that carries code-point 10 is encoded as `&#13;` and vice versa. Any caller that exercises the whitespace branches of `escape_char` (the xs:list serializer is the in-tree consumer) emits content that disagrees with the XML spec."

[[tasks.tasks]]
property = "EscapeCharCodes"
witnesses = [
  { test_fn = "witness_escape_char_codes_case_lf" },
  { test_fn = "witness_escape_char_codes_case_cr" },
]
