Skip to content

Commit

Permalink
test: Add two tests on MatchSpec's version comparison
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jerphanion <[email protected]>
  • Loading branch information
jjerphan committed Dec 10, 2024
1 parent 9d6281c commit 4c1b1ff
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libmamba/tests/src/specs/test_match_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,26 @@ namespace
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`
// which is currently supported but which must not.
SECTION("mingw-w64-ucrt-x86_64-crt-git v12.0.0.r2.ggc561118da h707e725_0")
Expand Down

0 comments on commit 4c1b1ff

Please sign in to comment.