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:
parent
bf084be685
commit
6c0b53af59
1 changed files with 13 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue