Skip to content

Commit 14c3744

Browse files
committed
fix: assure date-tests won't fail over time.
Need to use absolute timestamps as it's impossible to control the system time.
1 parent 1fe201a commit 14c3744

File tree

1 file changed

+7
-3
lines changed
  • gix/tests/gix/repository

1 file changed

+7
-3
lines changed

gix/tests/gix/repository/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@ mod revision {
2727
fn date() -> crate::Result {
2828
let repo = crate::named_repo("make_rev_parse_repo.sh")?;
2929
let actual = repo
30-
.rev_parse_single("old@{10 years ago}")
30+
.rev_parse_single("old@{20 years ago}")
3131
.expect("it returns the oldest possible rev when overshooting");
3232
assert_eq!(actual, hex_to_id("be2f093f0588eaeb71e1eff7451b18c2a9b1d765"));
3333

3434
let actual = repo
35-
.rev_parse_single("old@{1 month ago}")
35+
.rev_parse_single("old@{1732184844}")
3636
.expect("it finds something in the middle");
37-
assert_eq!(actual, hex_to_id("b29405fe9147a3a366c4048fbe295ea04de40fa6"));
37+
assert_eq!(
38+
actual,
39+
hex_to_id("b29405fe9147a3a366c4048fbe295ea04de40fa6"),
40+
"It also figures out that we don't mean an index, but a date"
41+
);
3842
Ok(())
3943
}
4044
}

0 commit comments

Comments
 (0)