diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-03-04 12:19:14 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-03-04 12:19:14 +0000 |
| commit | 050d9978193d6e0802d045c2b6897117a5a90b61 (patch) | |
| tree | 60a0212f8490242eb8a78f4e4e323fe985048e04 /test_utils | |
| parent | d9765c35e89e6e1a4fbc4b466f92a4b709a62a8c (diff) | |
refactor: improve rexpect error message
to enable better debugging
Diffstat (limited to 'test_utils')
| -rw-r--r-- | test_utils/src/lib.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index 712753e..b4f0360 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs | |||
| @@ -709,7 +709,7 @@ impl CliTester { | |||
| 709 | match self | 709 | match self |
| 710 | .rexpect_session | 710 | .rexpect_session |
| 711 | .exp_eof() | 711 | .exp_eof() |
| 712 | .context("expected immediate end but got timed out") | 712 | .context("expected end but got timed out") |
| 713 | { | 713 | { |
| 714 | Ok(before) => Ok(before), | 714 | Ok(before) => Ok(before), |
| 715 | Err(e) => { | 715 | Err(e) => { |
| @@ -744,9 +744,7 @@ impl CliTester { | |||
| 744 | } | 744 | } |
| 745 | 745 | ||
| 746 | pub fn expect_end_eventually_and_print(&mut self) -> Result<()> { | 746 | pub fn expect_end_eventually_and_print(&mut self) -> Result<()> { |
| 747 | let before = self | 747 | let before = self.exp_eof().context("expected end but got timed out")?; |
| 748 | .exp_eof() | ||
| 749 | .context("expected immediate end but got timed out")?; | ||
| 750 | println!("ended eventually with:"); | 748 | println!("ended eventually with:"); |
| 751 | println!("{}", &before); | 749 | println!("{}", &before); |
| 752 | Ok(()) | 750 | Ok(()) |