| 119 | |
| 120 | #[test] |
| 121 | fn stderr_example() { |
| 122 | Command::cargo_bin("bin_fixture") |
| 123 | .unwrap() |
| 124 | .env("stdout", "hello") |
| 125 | .env("stderr", "world") |
| 126 | .assert() |
| 127 | .stderr(predicate::eq(b"world\n" as &[u8])); |
| 128 | |
| 129 | Command::cargo_bin("bin_fixture") |
| 130 | .unwrap() |
| 131 | .env("stdout", "hello") |
| 132 | .env("stderr", "world") |
| 133 | .assert() |
| 134 | .stderr(predicate::str::diff("world\n")); |
| 135 | |
| 136 | Command::cargo_bin("bin_fixture") |
| 137 | .unwrap() |
| 138 | .env("stdout", "hello") |
| 139 | .env("stderr", "world") |
| 140 | .assert() |
| 141 | .stderr(b"world\n" as &[u8]); |
| 142 | |
| 143 | Command::cargo_bin("bin_fixture") |
| 144 | .unwrap() |
| 145 | .env("stdout", "hello") |
| 146 | .env("stderr", "world") |
| 147 | .assert() |
| 148 | .stderr(vec![b'w', b'o', b'r', b'l', b'd', b'\n']); |
| 149 | |
| 150 | Command::cargo_bin("bin_fixture") |
| 151 | .unwrap() |
| 152 | .env("stdout", "hello") |
| 153 | .env("stderr", "world") |
| 154 | .assert() |
| 155 | .stderr("world\n"); |
| 156 | } |