Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: from_string accepts incomplete version strings #22

Open
daixtrose opened this issue May 30, 2021 · 1 comment
Open

Comments

@daixtrose
Copy link

daixtrose commented May 30, 2021

The test

TEST_CASE("semver::from_string", "[demo]")
{
    using namespace semver;
    // auto version = semver::from_string("1.0.0"); // SUCCEEDS
    auto version = semver::from_string("1.0"); // FAILS
    REQUIRE(version == "1.0.0"_version);
}

fails with an exception

semver::version::from_string invalid version.

It is quite common to omit the patch version. So the from_string/from_chars function pair should be robust against the omission and add .0.

@Neargye Neargye self-assigned this May 30, 2021
@MHebes
Copy link

MHebes commented Oct 26, 2021

1.0 is not technically a valid semver for what it's worth

@Neargye Neargye removed their assignment Feb 21, 2023
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

No branches or pull requests

3 participants