Skip to content

It's wrong when i test a semver 2.0 string #7

@copperyp

Description

@copperyp

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions