test: property-based fuzzing (proptest) for every untrusted-input parser — message line, PROXY header, WebSocket frame, regex engine, ban-mask, duration; asserts no-panic + round-trip/idempotence/bounds invariants
This commit is contained in:
parent
cf2b157842
commit
621f06448d
7 changed files with 85 additions and 0 deletions
14
src/xline.rs
14
src/xline.rs
|
|
@ -371,3 +371,17 @@ impl Server {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use proptest::prelude::*;
|
||||
|
||||
proptest! {
|
||||
// Fuzz the duration parser: no arbitrary string may panic it.
|
||||
#[test]
|
||||
fn parse_duration_never_panics(s in ".*") {
|
||||
let _ = parse_duration(&s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue