diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2021-09-01 05:48:06 +0000 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2021-09-01 05:48:06 +0000 |
| commit | 10097e446745e8d443fc28323b7e58ae3e8167cf (patch) | |
| tree | 70410e74dc49f9f1d47fcc5700ef81bc95b34875 /tests | |
| parent | a56b1be2ec363ef4438e3692b4b120b8b1d2e86d (diff) | |
Refactor test code and CI
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/util/mod.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/util/mod.rs b/tests/util/mod.rs index cd29b28..c965ffd 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -44,16 +44,20 @@ impl Hdwallet { self.command.stdin(Stdio::piped()); } - let mut process = self.command.spawn().map_err(|err| err.to_string())?; + let mut process = self.command.spawn().unwrap(); - if let Some(data) = self.stdin { + let input = self.stdin.map(|data| { let mut stdin = process.stdin.take().unwrap(); thread::spawn(move || { stdin.write_all(&data).unwrap(); - }); + }) + }); + + let output = process.wait_with_output().unwrap(); + if let Some(input) = input { + input.join().unwrap(); } - let output = process.wait_with_output().map_err(|err| err.to_string())?; if output.status.success() { Ok(string_from_utf8(output.stdout)) } else { |
