diff --git a/crates/roads/tests/qa_findings.rs b/crates/roads/tests/qa_findings.rs index 8213b33..0a8f7c4 100644 --- a/crates/roads/tests/qa_findings.rs +++ b/crates/roads/tests/qa_findings.rs @@ -234,3 +234,30 @@ fn f08_mesh_addresses_are_never_internet_addresses() { "198.51.100.4 was accepted as a mesh address; an exit's `internet` rule covers it" ); } + +/// F-09. An empty value means "absent" (docs/FORMATS.md), and for the two conditions that narrow a road absent +/// is the widest value: `until:` left empty is a permanent grant and `ports:` left empty is all traffic, with no +/// problem reported. The same failure as QA R-35 (a misspelt `until`), reached by deleting the value instead. +#[test] +#[ignore = "QA F-09 (major): an emptied `until:` or `ports:` silently widens the road to its maximum"] +fn f09_an_emptied_narrowing_condition_is_an_error() { + for (from, to) in [ + ("until: 2026-11-29T23:59:59+01:00\n", "until:\n"), + ("ports: [tcp/443]\n", "ports:\n"), + ("until: 2026-11-29T23:59:59+01:00\n", "until: # Sunday\n"), + ] { + let text = Parts::home().road_text("7tq0mz").replace(from, to); + assert!(text.contains(to), "fixture edit {to:?}"); + let c = Parts::home().replace_road("7tq0mz", &text).compile(); + assert!( + c.problems.iter().any(|p| p.path.contains("7tq0mz")), + "`{}` compiled as {} with no problem reported", + to.trim_end(), + if to.starts_with("until") { + "a permanent grant" + } else { + "all traffic" + } + ); + } +}