Skip to content

Commit

Permalink
compare up to microseconds precision, that's the best pg will do I gu…
Browse files Browse the repository at this point in the history
…ess?
  • Loading branch information
jeromegn committed Dec 5, 2024
1 parent 2dcff3f commit f51e271
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/corro-pg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3311,7 +3311,10 @@ mod tests {
let updated_at = row.try_get::<_, NaiveDateTime>(0)?;
println!("updated_at: {updated_at:?}");

assert_eq!(now, updated_at.and_utc());
assert_eq!(
now.timestamp_micros(),
updated_at.and_utc().timestamp_micros()
);

let future: DateTime<Utc> = Utc::now() + Duration::from_secs(1);
println!("NOW: {future:?}");
Expand All @@ -3327,7 +3330,10 @@ mod tests {
let updated_at = row.try_get::<_, NaiveDateTime>(0)?;
println!("updated_at: {updated_at:?}");

assert_eq!(future, updated_at.and_utc());
assert_eq!(
future.timestamp_micros(),
updated_at.and_utc().timestamp_micros()
);

let row = client
.query_one(
Expand Down

0 comments on commit f51e271

Please sign in to comment.