[M8] cargoxx-git dependencies: { git = ..., rev = ... } deps
This commit is contained in:
@@ -336,3 +336,40 @@ mylib = { components = ["a"] }
|
||||
REQUIRE_FALSE(r.has_value());
|
||||
REQUIRE(r.error().code == ErrorCode::ManifestInvalidField);
|
||||
}
|
||||
|
||||
TEST_CASE("parse recognizes { git = \"...\", rev = \"...\" } as a cargoxx git dep",
|
||||
"[manifest][parse]") {
|
||||
auto p = write_manifest(R"(
|
||||
[package]
|
||||
name = "consumer"
|
||||
version = "0.1.0"
|
||||
edition = "cpp23"
|
||||
|
||||
[dependencies]
|
||||
mylib = { git = "https://gitea.example/me/mylib", rev = "0123456789012345678901234567890123456789" }
|
||||
)");
|
||||
auto r = parse(p);
|
||||
REQUIRE(r.has_value());
|
||||
REQUIRE(r->dependencies.size() == 1);
|
||||
const auto& dep = r->dependencies[0];
|
||||
REQUIRE(dep.name == "mylib");
|
||||
REQUIRE(dep.source == cargoxx::manifest::DepSource::CargoxxGit);
|
||||
REQUIRE(dep.git_url == "https://gitea.example/me/mylib");
|
||||
REQUIRE(dep.git_rev == "0123456789012345678901234567890123456789");
|
||||
REQUIRE(dep.version_spec == "*");
|
||||
}
|
||||
|
||||
TEST_CASE("parse rejects git dep without rev", "[manifest][parse]") {
|
||||
auto p = write_manifest(R"(
|
||||
[package]
|
||||
name = "consumer"
|
||||
version = "0.1.0"
|
||||
edition = "cpp23"
|
||||
|
||||
[dependencies]
|
||||
mylib = { git = "https://gitea.example/me/mylib" }
|
||||
)");
|
||||
auto r = parse(p);
|
||||
REQUIRE_FALSE(r.has_value());
|
||||
REQUIRE(r.error().code == ErrorCode::ManifestInvalidField);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user