test_datetime_format¶
The datetime formatter’s golden, and the constants the tile divides by.
The tile has no divider: every division in it is a multiply-shift by a compile-time constant, and a multiply-shift identity is only valid over a bounded input range. Those bounds are the whole correctness argument for the arithmetic, and they live in the HDL as bare magic numbers – so this reads them back out of the .sv and proves each one against real floor division at BOTH ENDS of every quotient block, which is where such an identity fails first. A constant edited in the HDL without its range being re-derived fails here rather than in a rendered date.
Attributes¶
Functions¶
|
|
|
|
|
|
|
|
|
Leap handling is not special-cased anywhere -- it falls out of the |
Module Contents¶
- test_datetime_format.EPOCH¶
- test_datetime_format.MULTIPLY_SHIFT_SITES¶
- test_datetime_format._hdl_constants() dict[str, int]¶
- test_datetime_format.test_the_tiles_multiply_shift_constants_are_exact_over_their_declared_range(site: str, pre_shift: int, divisor: int, max_input: int) None¶
- test_datetime_format.test_the_golden_agrees_with_the_standard_library_at_the_boundaries() None¶
- test_datetime_format.test_the_golden_agrees_with_the_standard_library_over_a_random_sweep() None¶
- test_datetime_format.test_every_day_of_one_leap_year_and_one_common_year_renders() None¶
Leap handling is not special-cased anywhere – it falls out of the 400-year era arithmetic – so the way to check it is to walk the days.
- test_datetime_format.test_out_of_range_epochs_have_no_rendering() None¶