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.

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

11 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.
33
44 >>> format_time(0, 0)
55 '00:00'
66 >>> format_time(1, 23)
7- '1:23'
7+ '01:23'
88 """
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

failpass·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