diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-20 16:22:10 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-20 16:48:48 +0000 |
| commit | 141ebf0cc0c6cfea640debc9b9073303509a8bc7 (patch) | |
| tree | 579ef546ea83b13a56066e44c43318ad9ed4f3d0 /test_utils/src | |
| parent | c2817d081700d1fe14d92c51c4e89551182e7fb6 (diff) | |
feat(list): set checkout branch as default choice
instead of no default. note: I spent hours trying to get
CliTester to support default choices and gave up.
I have a stashed the attempt and am moving on...
Diffstat (limited to 'test_utils/src')
| -rw-r--r-- | test_utils/src/lib.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index 089b052..3808a02 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs | |||
| @@ -479,7 +479,16 @@ impl CliTesterChoicePrompt<'_> { | |||
| 479 | Ok(self) | 479 | Ok(self) |
| 480 | } | 480 | } |
| 481 | 481 | ||
| 482 | pub fn succeeds_with(&mut self, chosen_index: u64, report: bool) -> Result<&mut Self> { | 482 | pub fn succeeds_with( |
| 483 | &mut self, | ||
| 484 | chosen_index: u64, | ||
| 485 | report: bool, | ||
| 486 | default_index: Option<u64>, | ||
| 487 | ) -> Result<&mut Self> { | ||
| 488 | if default_index.is_some() { | ||
| 489 | println!("TODO: add support for default choice") | ||
| 490 | } | ||
| 491 | |||
| 483 | fn show_options( | 492 | fn show_options( |
| 484 | tester: &mut CliTester, | 493 | tester: &mut CliTester, |
| 485 | choices: &Vec<String>, | 494 | choices: &Vec<String>, |