MCPcopy Index your code
hub / github.com/assert-rs/assert_cmd / run

Function run

examples/example_fixture.rs:9–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7use std::process;
8
9fn run() -> Result<(), Box<dyn Error>> {
10 if let Ok(text) = env::var("stdout") {
11 println!("{text}");
12 }
13 if let Ok(text) = env::var("stderr") {
14 eprintln!("{text}");
15 }
16
17 let code = env::var("exit")
18 .ok()
19 .map(|v| v.parse::<i32>())
20 .map(|r| r.map(Some))
21 .unwrap_or(Ok(None))?
22 .unwrap_or(0);
23 process::exit(code);
24}
25
26fn main() {
27 let code = match run() {

Callers 1

mainFunction · 0.70

Calls 1

okMethod · 0.45

Tested by

no test coverage detected