Skip to content

Document coerce returning null on invalid version#197

Merged
piotrooo merged 2 commits intosemver4j:mainfrom
gervaisj:patch-1
Nov 29, 2023
Merged

Document coerce returning null on invalid version#197
piotrooo merged 2 commits intosemver4j:mainfrom
gervaisj:patch-1

Conversation

@gervaisj
Copy link
Copy Markdown
Contributor

In the README:

Using Semver.coerce() method

[...]

If the version is invalid, a SemverException will be thrown.

I believe this has changed, since running:

Semver coerce = Semver.coerce("invalid");

produces coerce == null.

This PR matches the coerce example with the one from parse, and removes the mention to SemverException.

@piotrooo piotrooo added the enhancement New feature or request label Nov 29, 2023
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (19bdf3e) 91.54% compared to head (ff02046) 91.54%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #197   +/-   ##
=========================================
  Coverage     91.54%   91.54%           
  Complexity      266      266           
=========================================
  Files            21       21           
  Lines           639      639           
  Branches        103      103           
=========================================
  Hits            585      585           
  Misses           19       19           
  Partials         35       35           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@piotrooo
Copy link
Copy Markdown
Member

Good catch! I've also added the missing test. Many thanks!

@piotrooo piotrooo merged commit 3d9e17b into semver4j:main Nov 29, 2023
@piotrooo piotrooo self-requested a review November 29, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants