Browse Source

test: add format time RFC2822 test

main
fdai7375 2 years ago
parent
commit
3338ff1e6c
  1. 9
      src/builtins/time.rs

9
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"
)
}
}
Loading…
Cancel
Save