mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Add a new crate `deltachat_time` with a fake `struct SystemTimeTools` for mocking `SystemTime::now()` for test purposes. One still needs to use `std::time::SystemTime` as a struct representing a system time. I think such a minimalistic approach is ok -- even if somebody uses the original `SystemTime::now()` instead of the mock by mistake, that could break only tests but not the program itself. The worst thing that can happen is that tests using `SystemTime::shift()` and checking messages timestamps f.e. wouldn't catch the corresponding bugs, but now we don't have such tests at all which is much worse.
9 lines
140 B
TOML
9 lines
140 B
TOML
[package]
|
|
name = "deltachat-time"
|
|
version = "1.0.0"
|
|
description = "Time-related tools"
|
|
edition = "2021"
|
|
license = "MPL-2.0"
|
|
|
|
[dependencies]
|