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

Function code_example

tests/assert.rs:62–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60
61#[test]
62fn code_example() {
63 Command::cargo_bin("bin_fixture")
64 .unwrap()
65 .env("exit", "42")
66 .assert()
67 .code(predicate::eq(42));
68
69 Command::cargo_bin("bin_fixture")
70 .unwrap()
71 .env("exit", "42")
72 .assert()
73 .code(42);
74
75 Command::cargo_bin("bin_fixture")
76 .unwrap()
77 .env("exit", "42")
78 .assert()
79 .code(&[2, 42] as &[i32]);
80}
81
82#[test]
83fn stdout_example() {

Callers

nothing calls this directly

Calls 5

cargo_binFunction · 0.85
codeMethod · 0.80
envMethod · 0.80
assertMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected