Skip to content

Commit 6d4f003

Browse files
committed
tests: set timezone to UTC0 in integration tests
1 parent f1f2c47 commit 6d4f003

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/common/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
// For the full copyright and license information, please view the LICENSE
22
// file that was distributed with this source code.
33

4+
use std::env;
5+
46
use chrono::{DateTime, FixedOffset};
57
use parse_datetime::{parse_datetime, parse_datetime_at_date};
68

79
pub fn check_absolute(input: &str, expected: &str) {
10+
env::set_var("TZ", "UTC0");
11+
812
let parsed = match parse_datetime(input) {
913
Ok(v) => v,
1014
Err(e) => panic!("Failed to parse date from value '{input}': {e}"),
@@ -18,6 +22,8 @@ pub fn check_absolute(input: &str, expected: &str) {
1822
}
1923

2024
pub fn check_relative(now: DateTime<FixedOffset>, input: &str, expected: &str) {
25+
env::set_var("TZ", "UTC0");
26+
2127
let parsed = match parse_datetime_at_date(now.into(), input) {
2228
Ok(v) => v,
2329
Err(e) => panic!("Failed to parse date from value '{input}': {e}"),

0 commit comments

Comments
 (0)