One function
format_time in cuu508/cronsim
The author described this change as “Fix digital time formatting (use HH:MM instead H:MM)”. It counts as a record because the check below fails on the code as it stood at 9e18d74df and passes on 81f4e4f97, with nothing else changed between the two runs.
Projectcuu508/cronsim
Fix saved2023-04-27
Sharing licenceBSD-3-Clause · LICENSE
Change size+3 −6
What the code was meant to do, written into the code itself as a docstring
Format hours and minutes as a 24-hour time.
The change
| 1 | 1 | def format_time(h: int, m: int) -> str: | |
| 2 | - | """Format hours and minutes as a 24-hour time. | |
| 2 | + | """Format hours and minutes as HH:MM. | |
| 3 | 3 | ||
| 4 | 4 | >>> format_time(0, 0) | |
| 5 | 5 | '00:00' | |
| 6 | 6 | >>> format_time(1, 23) | |
| 7 | - | '1:23' | |
| 7 | + | '01:23' | |
| 8 | 8 | """ | |
| 9 | - | if h == 0: | |
| 10 | - | return f"00:{m:02d}" | |
| 11 | - | ||
| 12 | - | return f"{h}:{m:02d}" | |
| 9 | + | return f"{h:02d}:{m:02d}" |
The check that tells the two apart
fail→pass·tests/test_explain.py::TestHourField::test
Check file tests/test_explain.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it9e18d74df2f5462ba576e18f6f3e9521695e76f3
Broken version dated2023-04-27
Modulecronsim.explain
Units changedformat_time
Fingerprint6a6f7839985e6168
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in cuu508/cronsim
- 2021-04-28Fix more weekday handling bugs
- 2021-04-28Fix weekday handling bugs