radicle-heartwood-lfs/radicle-cli
Fintan Halpenny 2584ecdb0a
radicle: Pin timestamp for testing
When testing the CLI, "since"-calculations will result in different
values over time:

    now
    1 month ago
    2 months ago
    10 months ago
    1 year ago
    10 years ago

Initially, the solution was to use the wildcard match from `snapbox`,
`[..]`, to match on these values. However, since these values change
in length it means that they will affect the width of the tables
produced by the CLI.

To ensure the width is stable across runs over time it's possible to
use a time that is the same as the commit time used at testing.

To do this the `Timestamp` type is now a newtype which has a
constructor `now` which will use the `RAD_COMMIT_TIME` env variable
for construction, if it's available and in debug mode. This ensure
that all "since"-calculations will result in `now`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-10-30 14:48:38 +01:00
..
examples radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
src cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
tests cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
Cargo.toml cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00