TST: Add tests for `to_offset` with leading zeroes

Test for the issues fixed by cbc8c73fdf617a4644baa130dff05476c7a61645.