Mocking the system clock #295
Answered
by
BurntSushi
igorakkerman
asked this question in
Q&A
-
|
Is there a way to mock the system clock in order to test functionality that relies on the current time? Specifically, I would like |
Beta Was this translation helpful? Give feedback.
Answered by
BurntSushi
Mar 11, 2025
Replies: 1 comment 4 replies
-
|
Not presently. I am open to adding it, but I am highly skeptical of it. In order to be convinced I'll likely want to see detailed use cases and why alternatives aren't approrpriate. And I'll also want to know why the standard library doesn't need to provide this and what the consequences of that are. |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
BurntSushi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not presently. I am open to adding it, but I am highly skeptical of it. In order to be convinced I'll likely want to see detailed use cases and why alternatives aren't approrpriate. And I'll also want to know why the standard library doesn't need to provide this and what the consequences of that are.