-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
I using below code to test a semver 2.0 string.
code:
{
const std::string ver1 = "1.2.3-rc.4";
const std::string ver2 = ">1.1 <2.0";
const bool intersected = semver::intersects(ver1, ver2);
std::cout << "\"" << ver1
<< "\" and \"" << ver2
<< "\" are " << (intersected ? "" : "not ")
<< "intersected." << std::endl;
}
{
const std::string ver = "1.2.3-rc.4";
const std::string range = "1.x || >=2.5.0 || 5.0.0 - 7.2.3";
const bool satisfied = semver::satisfies(ver, range);
std::cout << "\"" << ver
<< "\" is " << (satisfied ? "" : "not ")
<< "satisfied by "
<< "\"" << range << "\"." << std::endl;
}
result:
"1.2.3-rc.4" and ">1.1 <2.0" are not intersected.
"1.2.3-rc.4" is not satisfied by "1.x || >=2.5.0 || 5.0.0 - 7.2.3".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels