Skip to content

Commit

Permalink
Merge pull request #30 from orefalo/PR
Browse files Browse the repository at this point in the history
fix timezone issue with tests
  • Loading branch information
pksunkara authored Nov 29, 2023
2 parents 277f114 + 4a6c3a4 commit 9bd5563
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ mod tests {
#[pg_test]
fn test_ulid_to_timestamp() {
let result =
Spi::get_one::<&str>(&format!("SELECT '{TEXT}'::ulid::timestamp::text;")).unwrap();
Spi::get_one::<&str>(&format!("set timezone TO 'UTC'; SELECT '{TEXT}'::ulid::timestamp::text;")).unwrap();
assert_eq!(Some(TIMESTAMP), result);
}

#[pg_test]
fn test_timestamp_to_ulid() {
let result =
Spi::get_one::<&str>(&format!("SELECT '{TIMESTAMP}'::timestamp::ulid::text;")).unwrap();
Spi::get_one::<&str>(&format!("set timezone TO 'UTC'; SELECT '{TIMESTAMP}'::timestamp::ulid::text;")).unwrap();
assert_eq!(Some("01GV5PA9EQ0000000000000000"), result);
}

Expand Down

0 comments on commit 9bd5563

Please sign in to comment.