[roads] QA F-09: an emptied until: or ports: silently widens a road (failing test, ignored)
until: with no value (or only a comment) reads as absent, so a temporary grant becomes permanent; ports: with no value reads as all traffic. No problem is reported. Verified to fail on this code.
This commit is contained in:
@@ -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"
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user