Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: date formatting in cache tests #428

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

TinyTinni
Copy link
Contributor

@TinyTinni TinyTinni commented Aug 6, 2024

This PR fixes date formatting in the tests.

Problem is, that I used "%e" formatter, which space pads the days.
Therefore, those tests will pass on days with 2 numbers like 10.7.2024, but the tests will fail on single digit days like today 6.8.2024

This PR replaces the format with "%d" which does not space-pad the date but uses 0 pads.

ref link to the documentation: https://docs.rs/chrono/latest/chrono/format/strftime/index.html
ref link, that 0 padding might be the way to go https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since under : "A 2-digit day number of the month. Examples: "04", "23"."

@TinyTinni TinyTinni changed the title fix: date formatting in cache tests fix: date formatting in cache tests on the first days of a month Aug 6, 2024
@sigoden sigoden changed the title fix: date formatting in cache tests on the first days of a month refactor: date formatting in cache tests Aug 7, 2024
@sigoden sigoden merged commit 3727dec into sigoden:main Aug 7, 2024
3 checks passed
@TinyTinni TinyTinni deleted the fix-date-formatting branch August 7, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants