diff --git a/src/Semver.cc b/src/Semver.cc index 975ed99e3..ed6272d43 100644 --- a/src/Semver.cc +++ b/src/Semver.cc @@ -475,6 +475,18 @@ void test_parse() { "1.2.3-\n" " ^ expected number or identifier" ); + ASSERT_EXCEPTION( + Version::parse("00"), SemverError, + "invalid semver:\n" + "00\n" + "^ invalid leading zero" + ); + ASSERT_EXCEPTION( + Version::parse("0.00.0"), SemverError, + "invalid semver:\n" + "0.00.0\n" + " ^ invalid leading zero" + ); ASSERT_EXCEPTION( Version::parse("a.b.c"), SemverError, "invalid semver:\n"