sociomantic-tsunami / ocean

General purpose, platform-dependent, high-performance library for D
Other
61 stars 56 forks source link

Zero pad milliseconds to 3 places #790

Closed andrew-stevenson-sociomantic closed 4 years ago

andrew-stevenson-sociomantic commented 4 years ago

Reverts behavioural change from dcf428aa

andrew-stevenson-sociomantic commented 4 years ago

@Geod24 FYI

codecov[bot] commented 4 years ago

Codecov Report

Merging #790 into v5.x.x will increase coverage by 0.05%. The diff coverage is 100%.

andrew-stevenson-sociomantic commented 4 years ago

Well its not really that important apart from stopping it looking odd. If other things happen to have depended on the format always using 0 padding then that is really more a bug with them.

The real problem was the un-noticed behavioural change - but that was presumably accidental. A unittest might have caught that but given this method now largely just calls sformat (presumably already tested) we are really only testing no one changes the format string - and that seems unlikely for anyone to do without due consideration. If someone does decide to re-write it again then comparing old a new behaviour can be a task for them.

Geod24 commented 4 years ago

Oops, good catch!

A unittest might have caught that

There was no unittest in place for those classes at the time. So the first thing I did was to introduce an unittest, but the value I used did not exhibit the issue.