diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-06-21 22:18:12 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-06-21 23:31:34 +0100 |
| commit | 681fdd7683363c62251ecd8dabcc1931a18f4840 (patch) | |
| tree | d9bcefb76e8617604bead820a0bdb9b8ec7c2ffe /test_utils/src/lib.rs | |
| parent | 8b8a5c43c101718f319cfbb8904d962e7335160b (diff) | |
build: fix CLITesterConfirmPrompt succeeds with
when the non-default option correctly sent
Diffstat (limited to 'test_utils/src/lib.rs')
| -rw-r--r-- | test_utils/src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index 1d881cf..ff1f41b 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs | |||
| @@ -438,11 +438,11 @@ impl CliTesterConfirmPrompt<'_> { | |||
| 438 | } | 438 | } |
| 439 | 439 | ||
| 440 | pub fn succeeds_with(&mut self, input: Option<bool>) -> Result<&mut Self> { | 440 | pub fn succeeds_with(&mut self, input: Option<bool>) -> Result<&mut Self> { |
| 441 | self.tester.send_line(match input { | 441 | match input { |
| 442 | None => "", | 442 | None => self.tester.send_line(""), |
| 443 | Some(true) => "y", | 443 | Some(true) => self.tester.send("y"), |
| 444 | Some(false) => "n", | 444 | Some(false) => self.tester.send("n"), |
| 445 | })?; | 445 | }?; |
| 446 | self.tester | 446 | self.tester |
| 447 | .expect("\r") | 447 | .expect("\r") |
| 448 | .context("expect new line after confirm input to be printed")?; | 448 | .context("expect new line after confirm input to be printed")?; |