#time #testing #deterministic #control-flow #instant #fake #interface

fake_instant

Fake clock for deterministic testing of code depending on time

2 unstable releases

0.5.0 Apr 29, 2023
0.4.0 Nov 5, 2019

#17 in #instant

Download history 253/week @ 2024-03-11 218/week @ 2024-03-18 189/week @ 2024-03-25 231/week @ 2024-04-01 253/week @ 2024-04-08 123/week @ 2024-04-15 232/week @ 2024-04-22 207/week @ 2024-04-29 232/week @ 2024-05-06 302/week @ 2024-05-13 174/week @ 2024-05-20 147/week @ 2024-05-27 202/week @ 2024-06-03 141/week @ 2024-06-10 72/week @ 2024-06-17 72/week @ 2024-06-24

498 downloads per month
Used in 3 crates

MIT OR BSD-3-Clause

12KB
212 lines

fake_instant

crates.io docs.rs gh-actions CI

This crate supplies a FakeInstant struct, which mimics the interface of std::time::Instant and enables full control over the flow of time as perceived by the code during testing.

License

This (former) SAFE Network library is dual-licensed under the Modified BSD (LICENSE-BSD https://opensource.org/licenses/BSD-3-Clause) or the MIT license (LICENSE-MIT http://opensource.org/licenses/MIT) at your option.

Contribution

Copyrights in the SAFE Network are retained by their contributors. No copyright assignment is required to contribute to this project.


lib.rs:

fake_clock

A crate providing a virtual clock mimicking std::time::Instant's interface, enabling full control over the flow of time during testing.

No runtime deps