(root: &Path, home: &Path, args: &[&str], stdin: &[u8])
| 142 | } |
| 143 | |
| 144 | fn atomic_stdin(root: &Path, home: &Path, args: &[&str], stdin: &[u8]) -> Output { |
| 145 | let mut child = Command::new(ATOMIC_BIN) |
| 146 | .args(args) |
| 147 | .current_dir(root) |
| 148 | .env("HOME", home) |
| 149 | .env("ATOMIC_HOME", home.join(".atomic")) |
| 150 | .stdin(Stdio::piped()) |
| 151 | .stdout(Stdio::piped()) |
| 152 | .stderr(Stdio::piped()) |
| 153 | .spawn() |
| 154 | .expect("run atomic with stdin"); |
| 155 | child |
| 156 | .stdin |
| 157 | .as_mut() |
| 158 | .unwrap() |
| 159 | .write_all(stdin) |
| 160 | .expect("write stdin"); |
| 161 | child.wait_with_output().expect("wait for atomic") |
| 162 | } |
| 163 | |
| 164 | fn decode_hex(hex: &str) -> Vec<u8> { |
| 165 | (0..hex.len()) |
no test coverage detected