We have added tests to ensure the default timezone is applied correctly. The tests use regex to check the output, as the output may vary across different machines.
#[cfg(test)]
mod tests {
use super::*;
use regex::Regex;
#[test]
fn test_check_output_match_timezone() {
let local_timezone_str = provide_local_timezone_string();
let re: Regex = Regex::new(r"^[a-zA-Z_/]+$").unwrap();
assert!(re.is_match(&local_timezone_str));
}
}
About
This pull request introduces a new feature that allows users to set a default timezone for the timezone_translator utility. The main changes include:
Feel free to merge as this is NOT a breaking change.
Issue
Comment on Reddit: https://www.reddit.com/r/rust/comments/1dr9x58/comment/laudhjq/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button Issue on Repo: https://github.com/shunsock/timezone_translator/issues/27
Test
We have added tests to ensure the default timezone is applied correctly. The tests use regex to check the output, as the output may vary across different machines.