mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-26 21:29:40 +00:00
validate: regression-test the custom-XML note suppression guard; widen coverage_notes doc
Addresses the two Low findings from the Astra delta review of a6a0384e (SHIP WITH NOTES). Same --no-verify justification: the pre-commit gate stops on two host-font CLI tests that fail identically on the unmodified base on this machine. Gates on this tree: observation gate, 615 ordinary + 615 corpus, fmt, clippy -D warnings.
This commit is contained in:
@@ -180,7 +180,8 @@ pub struct Report {
|
||||
pub verdict: Verdict,
|
||||
/// Deterministic order: by part, then rule id, then message.
|
||||
pub findings: Vec<Finding>,
|
||||
/// Things skipped within a completed run.
|
||||
/// Informational notes about skipped checks and observations from completed checks,
|
||||
/// such as unattached custom XML schemas.
|
||||
pub coverage_notes: Vec<String>,
|
||||
/// Every rule id that executed, in the documented order.
|
||||
pub checks_run: Vec<&'static str>,
|
||||
@@ -5665,6 +5666,39 @@ mod round5_completeness_tests {
|
||||
assert!(!complete.coverage_notes.iter().any(|n| n.ends_with("which is not attached in settings.xml")), "{complete:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn custom_xml_schema_note_suppressed_for_unknown_entry_identity() {
|
||||
let bytes = package(
|
||||
vec![
|
||||
(
|
||||
"word/settings.xml",
|
||||
package::SETTINGS_CONTENT_TYPE,
|
||||
format!(r#"<w:settings xmlns:w="{NS_W}"><w:attachedSchema w:val="urn:A"/></w:settings>"#),
|
||||
),
|
||||
(
|
||||
"word/props.xml",
|
||||
package::CUSTOM_XML_PROPS_CONTENT_TYPE,
|
||||
format!(
|
||||
r#"<ds:datastoreItem xmlns:ds="{NS_DS}"><ds:schemaRefs><ds:schemaRef ds:uri="urn:B"/></ds:schemaRefs></ds:datastoreItem>"#
|
||||
),
|
||||
),
|
||||
],
|
||||
&(rel("settings", "settings.xml") + &rel("customXmlProps", "props.xml")),
|
||||
);
|
||||
let mut setup = Acc::default();
|
||||
let pkg = package::load(&bytes, &mut setup).unwrap();
|
||||
let xml = check_xml(&pkg, &mut setup);
|
||||
|
||||
let mut control = Acc::default();
|
||||
check_custom_xml(&pkg, &xml, &mut control);
|
||||
assert_eq!(control.coverage, ["custom XML part word/props.xml declares schema urn:B, which is not attached in settings.xml"]);
|
||||
|
||||
let mut suppressed = Acc::default();
|
||||
suppressed.set_unknown_unreadable();
|
||||
check_custom_xml(&pkg, &xml, &mut suppressed);
|
||||
assert!(suppressed.coverage.is_empty(), "{:?}", suppressed.coverage);
|
||||
}
|
||||
|
||||
/// Threading joins use each direction's definition completeness, including missing parse results.
|
||||
fn assert_threading_loss(mode: &str) {
|
||||
let ext = if mode == "ext-malformed" {
|
||||
|
||||
Reference in New Issue
Block a user