open-standards/wai/http-conformance/falsify/merge-classes.patch
Transaction Science 1cddbdad19 wai: http-conformance falsification patches and their runner
Twelve patches, each breaking one function (the content hash's domain, the
root flag, the left-subtree rule, the chunk counter, the component digest
check, the Content-Range and content-coding checks, the union, the trailing-
byte rule, the missing-digest plan, the class merge, the selection digest
test), each naming the cases that must fail. run.sh applies each to a fresh
worktree, requires the build, and requires verify to fail naming them; then
the Python mutations and the differential.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 07:52:43 -04:00

15 lines
670 B
Diff

# must fail: plan_classes_O8
# ranges of different classes are merged (plan::plan_components)
diff --git a/wai/wai-rs/src/http_binding/plan.rs b/wai/wai-rs/src/http_binding/plan.rs
index 1d2902f7..fc58b047 100644
--- a/wai/wai-rs/src/http_binding/plan.rs
+++ b/wai/wai-rs/src/http_binding/plan.rs
@@ -151,7 +151,7 @@ pub fn plan_components(
let mut merged: Vec<(Class, u64, u64)> = Vec::new();
for (class, a, b) in pieces {
match merged.last_mut() {
- Some((c, _, e)) if *c == class && *e >= a => *e = (*e).max(b),
+ Some((_, _, e)) if *e >= a => *e = (*e).max(b),
_ => merged.push((class, a, b)),
}
}