diff options
| author | mo8it <mo8it@proton.me> | 2024-05-01 18:08:18 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-05-01 18:08:18 +0200 |
| commit | d425dbe203c17166e2e0b5692695448f0cb85513 (patch) | |
| tree | 7cd52c370e84090288b338b64080ada2b59de1a5 /src | |
| parent | 32415e1e6cca9e0fb9a3019ed8e75956c7f7f92e (diff) | |
Test run_cmd
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd.rs | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -75,3 +75,19 @@ impl<'a> CargoCmd<'a> { run_cmd(cmd, self.description, self.output) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_run_cmd() { + let mut cmd = Command::new("echo"); + cmd.arg("Hello"); + + let mut output = Vec::with_capacity(8); + run_cmd(cmd, "echo …", &mut output).unwrap(); + + assert_eq!(output, b"Hello\n\n"); + } +} |
