MCPcopy Create free account
hub / github.com/bytecodealliance/cargo-component / checks_for_duplicate_dependencies

Function checks_for_duplicate_dependencies

tests/add.rs:105–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104#[test]
105fn checks_for_duplicate_dependencies() -> Result<()> {
106 let project = Project::new("foo", true)?;
107 project.update_manifest(|mut doc| {
108 doc["package"]["metadata"]["component"]["dependencies"]["foo:bar"] = value("1.2.3");
109 Ok(doc)
110 })?;
111
112 project
113 .cargo_component(["add", "foo:bar"])
114 .assert()
115 .stderr(contains(
116 "cannot add dependency `foo:bar` as it conflicts with an existing dependency",
117 ))
118 .failure();
119
120 Ok(())
121}
122
123#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
124async fn prints_modified_manifest_for_dry_run() -> Result<()> {

Callers

nothing calls this directly

Calls 2

cargo_componentMethod · 0.80
update_manifestMethod · 0.45

Tested by

no test coverage detected