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

Function it_finds_errors

tests/check.rs:26–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25#[test]
26fn it_finds_errors() -> Result<()> {
27 let project = Project::new("foo", true)?;
28
29 let mut src = fs::read_to_string(project.root().join("src/lib.rs"))?;
30 write!(&mut src, "\n\nfn foo() -> String {{\n \"foo\"\n}}\n")?;
31
32 fs::write(project.root().join("src/lib.rs"), src)?;
33
34 project
35 .cargo_component(["check"])
36 .assert()
37 .stderr(contains("Checking foo v0.1.0").and(contains("expected `String`, found `&str`")))
38 .failure();
39
40 Ok(())
41}
42
43#[test]
44fn it_checks_a_workspace() -> Result<()> {

Callers

nothing calls this directly

Calls 2

rootMethod · 0.80
cargo_componentMethod · 0.80

Tested by

no test coverage detected