package time_test; import time; // Without these multipliers every caller would re-derive 1e9 in // place. The values themselves are nailed down by Hare's // ref/hare/time/duration.ha:9-18. @test fn constants() void = { assert(!((time.nanosecond: i64) != 1i64)); assert(!((time.microsecond: i64) != 1000i64)); assert(!((time.millisecond: i64) != 1000000i64)); assert(!((time.second: i64) != 1000000000i64)); // "Roundtrip" check: derived multiples land on the canonical // nanosecond count. Catches a future re-derivation drift. assert(!(5i64 * (time.second: i64) != 5000000000i64)); assert(!(3i64 * (time.millisecond: i64) != 3000000i64)); assert(!(7i64 * (time.microsecond: i64) != 7000i64)); };