diff --git a/src/builtins/time.rs b/src/builtins/time.rs index d1cb056..dbf47af 100644 --- a/src/builtins/time.rs +++ b/src/builtins/time.rs @@ -37,4 +37,13 @@ mod tests { fn test_time() { assert_eq!(Time.execute(&mut BuiltinConfig::new(), vec![]), Ok(())) } + + #[test] + fn test_format_time_rfc2822() { + let time = chrono::Utc.with_ymd_and_hms(6969, 4, 20, 4, 20, 9).unwrap(); + assert_eq!( + format_time(time, "RFC2822"), + "Thu, 20 Apr 6969 04:20:09 +0000" + ) + } }