mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 09:59:21 +02:00
more tests
This commit is contained in:
@ -58,3 +58,12 @@ impl fmt::Write for CachedDate {
|
||||
fn test_date_len() {
|
||||
assert_eq!(DATE_VALUE_LENGTH, "Sun, 06 Nov 1994 08:49:37 GMT".len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_date() {
|
||||
let mut buf1 = BytesMut::new();
|
||||
extend(&mut buf1);
|
||||
let mut buf2 = BytesMut::new();
|
||||
extend(&mut buf2);
|
||||
assert_eq!(buf1, buf2);
|
||||
}
|
||||
|
16
src/error.rs
16
src/error.rs
@ -144,7 +144,21 @@ mod tests {
|
||||
use std::error::Error as StdError;
|
||||
use std::io;
|
||||
use httparse;
|
||||
use super::ParseError;
|
||||
use http::StatusCode;
|
||||
use cookie::ParseError as CookieParseError;
|
||||
use super::{ParseError, HttpResponse, HttpRangeParseError};
|
||||
|
||||
#[test]
|
||||
fn test_into_response() {
|
||||
let resp: HttpResponse = ParseError::Incomplete.into();
|
||||
assert_eq!(resp.status(), StatusCode::BAD_REQUEST);
|
||||
|
||||
let resp: HttpResponse = HttpRangeParseError::InvalidRange.into();
|
||||
assert_eq!(resp.status(), StatusCode::BAD_REQUEST);
|
||||
|
||||
let resp: HttpResponse = CookieParseError::EmptyName.into();
|
||||
assert_eq!(resp.status(), StatusCode::BAD_REQUEST);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cause() {
|
||||
|
Reference in New Issue
Block a user