Skip to content

Commit

Permalink
Add semver tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Jan 3, 2024
1 parent 8a90672 commit 520c50e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Semver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 520c50e

Please sign in to comment.