Skip to content

Commit

Permalink
debug(tests): debug cuid test
Browse files Browse the repository at this point in the history
Signed-off-by: vados <[email protected]>
  • Loading branch information
t3hmrman committed Dec 11, 2023
1 parent acbcbfe commit 6e46a02
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/cuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ mod tests {
let parsed: DateTime<Utc> = DateTime::parse_from_rfc3339(&timestamp.to_iso_string())
.expect("extracted timestamp as ISO string parsed to UTC DateTime")
.into();
assert!(
Utc::now().signed_duration_since(parsed).num_seconds() < 3,
"extracted, printed & re-parsed cuid timestamp is from recent past (within 3s)"
);
// assert!(
// Utc::now().signed_duration_since(parsed).num_seconds() < 3,
// "extracted, printed & re-parsed cuid timestamp is from recent past (within 3s)"
// );
if !Utc::now().signed_duration_since(parsed).num_seconds() < 3 {
pgrx::error!("DID NOT MATCH. ORIGINAL: [{timestamp:?}], PARSED: [{parsed:?}]")
}
}
}

0 comments on commit 6e46a02

Please sign in to comment.