Skip to content

Commit c084001

Browse files
authored
Merge pull request uutils#31 from Benjscho/main
Add test for parsing epoch seconds
2 parents 497bebb + a35530e commit c084001

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/parse_datetime.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ mod tests {
190190
assert_eq!(from_str(dt), Err(ParseDurationError::InvalidInput));
191191
}
192192
}
193+
194+
#[test]
195+
fn test_epoch_seconds() {
196+
env::set_var("TZ", "UTC");
197+
let dt = "@1613371067";
198+
let actual = from_str(dt);
199+
assert_eq!(actual.unwrap().timestamp(), TEST_TIME);
200+
}
193201
}
194202

195203
#[cfg(test)]

0 commit comments

Comments
 (0)