diff options
Diffstat (limited to 'tests/time.rs')
| -rw-r--r-- | tests/time.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/tests/time.rs b/tests/time.rs index 3d4a203..a34202f 100644 --- a/tests/time.rs +++ b/tests/time.rs @@ -4,21 +4,9 @@ use aur_build::db::{builds, BuildState}; use aur_build::time; use common::Env; -#[test] -fn a_pinned_clock_moves_relative_arithmetic_with_it() { - time::pin("2026-01-01T00:00:00Z"); - assert_eq!(time::now(), "2026-01-01T00:00:00Z"); - assert_eq!(time::secs_ahead(90), "2026-01-01T00:01:30Z"); - assert_eq!(time::secs_ago(90), "2025-12-31T23:58:30Z"); - time::unpin(); -} - -#[test] -fn an_unpinned_clock_is_the_real_one() { - let now = time::now(); - assert_eq!(time::delta_secs(&now, &time::secs_ahead(60)), Some(60)); - assert_eq!(time::delta_secs(&now, &time::secs_ago(60)), Some(-60)); -} +// What remains is the test that needs a database: it pins a clock, takes a +// lease, and checks that expiry is measured against the pinned clock rather +// than the real one. The pure clock arithmetic moved into src/time.rs. #[test] fn a_lease_taken_under_a_pinned_clock_expires_against_that_clock() { |
