Skip to content

Commit 6c5d330

Browse files
committed
Updated roundtip date conversion tests
1 parent 957185a commit 6c5d330

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/parsers/fields/date.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,10 @@ pub static MONTH_MAP: &[u8; 31] = &[
488488
mod tests {
489489
use chrono::{FixedOffset, LocalResult, SecondsFormat, TimeZone, Utc};
490490

491-
use crate::parsers::{fields::load_tests, MessageStream};
491+
use crate::{
492+
parsers::{fields::load_tests, MessageStream},
493+
DateTime,
494+
};
492495

493496
#[test]
494497
fn parse_dates() {
@@ -528,6 +531,8 @@ mod tests {
528531
.unwrap()
529532
.to_rfc3339_opts(SecondsFormat::Secs, true)
530533
);
534+
let ts = datetime.to_timestamp();
535+
assert_eq!(DateTime::from_timestamp(ts).to_timestamp(), ts);
531536
}
532537
}
533538
_ => {}

0 commit comments

Comments
 (0)