Fix semver matcher differently.

This commit is contained in:
chriseth
2019-12-09 15:45:01 +01:00
parent 69e450038c
commit 9c3503834d
3 changed files with 16 additions and 17 deletions
+14 -5
View File
@@ -141,14 +141,14 @@ BOOST_AUTO_TEST_CASE(positive_range)
{"^0.1.2", "0.1.2"},
{"^0.1", "0.1.2"},
{"^1.2", "1.4.2"},
{"^1.2", "1.2.1-pre"},
{"^1.2", "1.2.0"},
{"^1", "1.2.0-pre"},
{"^1", "1.2.0"},
{"<=1.2.3", "1.2.3-beta"},
{">1.2", "1.3.0-beta"},
{"<1.2.3", "1.2.3-beta"},
{"^1.2 ^1", "1.4.2"}
{"^1.2 ^1", "1.4.2"},
{"^0", "0.5.1"},
{"^0", "0.1.1"},
};
for (auto const& t: tests)
{
@@ -163,13 +163,14 @@ BOOST_AUTO_TEST_CASE(positive_range)
BOOST_AUTO_TEST_CASE(negative_range)
{
// Positive range tests
// Negative range tests
vector<pair<string, string>> tests = {
{"1.0.0 - 2.0.0", "2.2.3"},
{"1.0", "1.0.0-pre"},
{"1", "1.0.0-pre"},
{"^1.2.3", "1.2.3-pre"},
{"^1.2", "1.2.0-pre"},
{"^1.2", "1.2.1-pre"},
{"^1.2.3", "1.2.3-beta"},
{"=0.7.x", "0.7.0-asdf"},
{">=0.7.x", "0.7.0-asdf"},
@@ -212,8 +213,16 @@ BOOST_AUTO_TEST_CASE(negative_range)
{"=1.2.3", "1.2.3-beta"},
{">1.2", "1.2.8"},
{"^1.2.3", "2.0.0-alpha"},
{"^0.6", "0.6.2-alpha"},
{"^0.6", "0.6.0-alpha"},
{"^1.2", "1.2.1-pre"},
{"^1.2.3", "1.2.2"},
{"^1.2", "1.1.9"}
{"^1", "1.2.0-pre"},
{"^1", "1.2.0-pre"},
{"^1.2", "1.1.9"},
{"^0", "0.5.1-pre"},
{"^0", "0.0.0-pre"},
{"^0", "1.0.0"},
};
for (auto const& t: tests)
{