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.
The test
fails with an exception
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
.