Skip to content

Support negative duration inputs - #15

Merged
HaGGi13 merged 2 commits into
developfrom
feature/14-support-negative-duration-inputs
Mar 8, 2026
Merged

Support negative duration inputs#15
HaGGi13 merged 2 commits into
developfrom
feature/14-support-negative-duration-inputs

Conversation

@HaGGi13

@HaGGi13 HaGGi13 commented Mar 8, 2026

Copy link
Copy Markdown
Owner

Enhanced the DurationTimeParser to include support for negative durations in both standard and human-readable formats.
By doing so the RegEx strings were extended and a bit reorganized to make their purpose clear and easy understandable.
In addition, because of rounding issues, it was necessary to split up the rounding logic into separate steps. The issues cause is still not clear, but with the one-liner we ended up with nano-seconds in the result.

All unit tests were extensively extended to cover negative cases, edge cases, boundary values, whitespace-padded input, case-insensitive input, and fractional unit handling - all related to negative inputs.
Furthermore existing tests were restructured for an easier readability.

Item: #14

HaGGi13 added 2 commits March 8, 2026 19:00
Enhanced the `DurationTimeParser` to include support for negative
durations in both standard and human-readable formats. By doing so the
RegEx strings were extended and a bit reorganized to make their purpose
clear and easy understandable.
In addition, because of rounding issues, it was necessary to split up
the rounding logic into separate steps. The issues cause is still not
clear, but with the one-liner we ended up with nano-seconds in the
result.

All unit tests were extensively extended to cover negative cases,
edge cases, boundary values, whitespace-padded input, case-insensitive
input, and fractional unit handling - all related to negative inputs.
Furthermore existing tests were restructured for an easier readability.

Item: #14
Added benchmarks to cover negative duration scenarios in both standard
and human-readable formats for `TryParse` and `Parse` methods.

Item: #14
@HaGGi13 HaGGi13 self-assigned this Mar 8, 2026
@HaGGi13
HaGGi13 merged commit be88d9f into develop Mar 8, 2026
4 checks passed
@HaGGi13
HaGGi13 deleted the feature/14-support-negative-duration-inputs branch March 8, 2026 20:19
HaGGi13 added a commit that referenced this pull request Mar 8, 2026
Enhanced the `DurationTimeParser` to include support for negative
durations in both standard and human-readable formats.
By doing so the RegEx strings were extended and a bit reorganized to
make their purpose clear and easy understandable.
In addition, because of rounding issues, it was necessary to split up
the rounding logic into separate steps. The issues cause is still not
clear, but with the one-liner we ended up with nano-seconds in the
result.

All unit tests were extensively extended to cover negative cases, edge
cases, boundary values, whitespace-padded input, case-insensitive input,
and fractional unit handling - all related to negative inputs.
Furthermore existing tests were restructured for an easier readability.

Item: #14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant