mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 01:44:25 +00:00
Cover oversized control lines
This commit is contained in:
@@ -46,5 +46,11 @@ mod tests {
|
||||
assert!(process_line("{", 100, call).unwrap().contains("bad request envelope:"));
|
||||
assert_eq!(process_line(r#"{"id":3}"#, 100, call).unwrap(), r#"{"error":"missing `method`","id":3,"ok":false}"#);
|
||||
assert!(process_line("abcdef", 2, call).unwrap().contains("byte limit"));
|
||||
let invoked = std::cell::Cell::new(false);
|
||||
let _ = process_line(" ", 2, |_, _| -> Result<Value, &'static str> {
|
||||
invoked.set(true);
|
||||
Ok(Value::Null)
|
||||
});
|
||||
assert!(!invoked.get());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user