test: Add two tests on MatchSpec's version comparison (#3679)

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
This commit is contained in:
Julien Jerphanion 2024-12-10 16:09:44 +01:00 committed by GitHub
parent bb38a698cf
commit 8c80ae90b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 0 deletions

View File

@ -108,6 +108,26 @@ namespace
REQUIRE(ms.str() == "kytea[version=\">=0.1.4,==0.2.0\"]"); REQUIRE(ms.str() == "kytea[version=\">=0.1.4,==0.2.0\"]");
} }
SECTION("abc>12")
{
auto ms = MatchSpec::parse("abc>12").value();
REQUIRE(ms.name().str() == "abc");
REQUIRE(ms.version().str() == ">12");
REQUIRE(ms.build_string().is_explicitly_free());
REQUIRE(ms.build_number().is_explicitly_free());
REQUIRE(ms.str() == "abc>12");
}
SECTION("abc[version='>3']")
{
auto ms = MatchSpec::parse("abc[version='>3']").value();
REQUIRE(ms.name().str() == "abc");
REQUIRE(ms.version().str() == ">3");
REQUIRE(ms.build_string().is_explicitly_free());
REQUIRE(ms.build_number().is_explicitly_free());
REQUIRE(ms.str() == "abc>3");
}
// Invalid case from `inform2w64-sysroot_win-64-v12.0.0.r2.ggc561118da-h707e725_0.conda` // Invalid case from `inform2w64-sysroot_win-64-v12.0.0.r2.ggc561118da-h707e725_0.conda`
// which is currently supported but which must not. // which is currently supported but which must not.
SECTION("mingw-w64-ucrt-x86_64-crt-git v12.0.0.r2.ggc561118da h707e725_0") SECTION("mingw-w64-ucrt-x86_64-crt-git v12.0.0.r2.ggc561118da h707e725_0")