Skip to content

Commit

Permalink
Use fixed date in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
octol committed Sep 9, 2024
1 parent 9088bd1 commit f8ba98f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions common/ip-packet-requests/src/v7/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ pub struct HealthRequest {

#[cfg(test)]
mod tests {
use time::macros::datetime;

use super::*;
use std::net::{Ipv4Addr, Ipv6Addr};
use std::str::FromStr;
Expand All @@ -432,13 +434,13 @@ mod tests {
reply_to_hops: None,
reply_to_avg_mix_delays: None,
buffer_timeout: None,
timestamp: OffsetDateTime::now_utc(),
timestamp: datetime!(2024-01-01 12:59:59.5 UTC),
},
signature: None,
}
),
};
assert_eq!(connect.to_bytes().unwrap().len(), 141);
assert_eq!(connect.to_bytes().unwrap().len(), 139);
}

#[test]
Expand Down

0 comments on commit f8ba98f

Please sign in to comment.