1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2025-04-11 04:14:06 +00:00

Add regression test

This commit is contained in:
Aaron Hill 2020-01-28 15:32:36 -05:00
parent bf084be685
commit 6c0b53af59
No known key found for this signature in database
GPG key ID: B4087E510E98B164

View file

@ -282,6 +282,19 @@ impl DateService {
mod tests {
use super::*;
// Test modifying the date from within the closure
// passed to `set_date`
#[test]
fn test_evil_date() {
let service = DateService::new();
// Make sure that `check_date` doesn't try to spawn a task
service.0.update();
service.set_date(|_| {
service.0.reset()
});
}
#[test]
fn test_date_len() {
assert_eq!(DATE_VALUE_LENGTH, "Sun, 06 Nov 1994 08:49:37 GMT".len());