[PR #428] [MERGED] refactor: date formatting in cache tests #609

Closed
opened 2026-04-08 16:53:38 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sigoden/dufs/pull/428
Author: @TinyTinni
Created: 8/6/2024
Status: Merged
Merged: 8/7/2024
Merged by: @sigoden

Base: mainHead: fix-date-formatting


📝 Commits (1)

  • 4d0cfe9 fix: date formatting in cache tests

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 tests/cache.rs (+1 -1)

📄 Description

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"."


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sigoden/dufs/pull/428 **Author:** [@TinyTinni](https://github.com/TinyTinni) **Created:** 8/6/2024 **Status:** ✅ Merged **Merged:** 8/7/2024 **Merged by:** [@sigoden](https://github.com/sigoden) **Base:** `main` ← **Head:** `fix-date-formatting` --- ### 📝 Commits (1) - [`4d0cfe9`](https://github.com/sigoden/dufs/commit/4d0cfe9bd73ec1368653bd6e07933de3bf7c65e8) fix: date formatting in cache tests ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/cache.rs` (+1 -1) </details> ### 📄 Description 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 <days>: "A 2-digit day number of the month. Examples: "04", "23"." --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-04-08 16:53:38 +03:00
zhus closed this issue 2026-04-08 16:53:39 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#609