From ac53bca7e315848864ff9e51703720b5b466bc42 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 16 Jul 2025 10:59:20 +0100 Subject: chore: bump nightly rustfmt to latest available and apply fmt fixes --- tests/ngit_list.rs | 366 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 224 insertions(+), 142 deletions(-) (limited to 'tests/ngit_list.rs') diff --git a/tests/ngit_list.rs b/tests/ngit_list.rs index c8f761a..0547ad4 100644 --- a/tests/ngit_list.rs +++ b/tests/ngit_list.rs @@ -201,11 +201,14 @@ mod when_main_branch_is_uptodate { p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; let mut c = p.expect_choice("", vec![ format!( @@ -317,11 +320,14 @@ mod when_main_branch_is_uptodate { p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(0, true, None)?; let mut c = p.expect_choice("", vec![ format!( @@ -436,12 +442,15 @@ mod when_main_branch_is_uptodate { p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("add d3.md"), // commit msg title - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("add d3.md"), // commit msg title + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(0, true, None)?; let mut c = p.expect_choice("", vec![ format!( @@ -511,12 +520,15 @@ mod when_main_branch_is_uptodate { p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("add d3.md"), // commit msg title - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("add d3.md"), // commit msg title + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(0, true, None)?; let mut c = p.expect_choice("", vec![ format!( @@ -630,11 +642,14 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; let mut c = p.expect_choice("", vec![ format!( @@ -652,18 +667,24 @@ mod when_main_branch_is_uptodate { p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; - let mut c = p.expect_choice("", vec![ - format!("checkout proposal branch (2 ahead 0 behind 'main')"), - format!("apply to current branch with `git am`"), - format!("download to ./patches"), - format!("back"), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout proposal branch (2 ahead 0 behind 'main')"), + format!("apply to current branch with `git am`"), + format!("download to ./patches"), + format!("back"), + ], + )?; c.succeeds_with(0, true, Some(0))?; p.expect_end_eventually_and_print()?; @@ -717,11 +738,14 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; let mut c = p.expect_choice("", vec![ format!( @@ -739,18 +763,24 @@ mod when_main_branch_is_uptodate { p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; - let mut c = p.expect_choice("", vec![ - format!("checkout proposal branch (2 ahead 0 behind 'main')"), - format!("apply to current branch with `git am`"), - format!("download to ./patches"), - format!("back"), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout proposal branch (2 ahead 0 behind 'main')"), + format!("apply to current branch with `git am`"), + format!("download to ./patches"), + format!("back"), + ], + )?; c.succeeds_with(0, true, Some(0))?; p.expect(format!( "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_1}(", @@ -823,18 +853,24 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; - let mut c = p.expect_choice("", vec![ - format!("checkout proposal branch and apply 1 appendments"), - format!("apply to current branch with `git am`"), - format!("download to ./patches"), - format!("back"), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout proposal branch and apply 1 appendments"), + format!("apply to current branch with `git am`"), + format!("download to ./patches"), + format!("back"), + ], + )?; c.succeeds_with(0, true, Some(0))?; p.expect("checked out proposal branch and applied 1 appendments (2 ahead 0 behind 'main')\r\n")?; p.expect_end()?; @@ -893,18 +929,24 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; - let mut c = p.expect_choice("", vec![ - format!("checkout proposal branch and apply 1 appendments"), - format!("apply to current branch with `git am`"), - format!("download to ./patches"), - format!("back"), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout proposal branch and apply 1 appendments"), + format!("apply to current branch with `git am`"), + format!("download to ./patches"), + format!("back"), + ], + )?; c.succeeds_with(0, true, Some(0))?; p.expect("checked out proposal branch and applied 1 appendments (2 ahead 0 behind 'main')\r\n")?; p.expect_end()?; @@ -1000,21 +1042,29 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; p.expect_eventually("--force`\r\n")?; - let mut c = p.expect_choice("", vec![ - format!("checkout local branch with unpublished changes"), - format!("discard unpublished changes and checkout new revision"), - format!("apply to current branch with `git am`"), - format!("download to ./patches"), - "back".to_string(), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout local branch with unpublished changes"), + format!( + "discard unpublished changes and checkout new revision" + ), + format!("apply to current branch with `git am`"), + format!("download to ./patches"), + "back".to_string(), + ], + )?; c.succeeds_with(1, true, Some(0))?; p.expect_end_eventually_and_print()?; @@ -1071,11 +1121,14 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; p.expect("you have an amended/rebase version the proposal that is unpublished\r\n")?; p.expect("you have previously applied the latest version of the proposal (2 ahead 0 behind 'main') but your local proposal branch has amended or rebased it (2 ahead 0 behind 'main')\r\n")?; @@ -1084,13 +1137,18 @@ mod when_main_branch_is_uptodate { p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?; p.expect("if you are confident in your changes consider running `ngit push --force`\r\n")?; - let mut c = p.expect_choice("", vec![ - format!("checkout local branch with unpublished changes"), - format!("discard unpublished changes and checkout new revision"), - format!("apply to current branch with `git am`"), - format!("download to ./patches"), - "back".to_string(), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout local branch with unpublished changes"), + format!( + "discard unpublished changes and checkout new revision" + ), + format!("apply to current branch with `git am`"), + format!("download to ./patches"), + "back".to_string(), + ], + )?; c.succeeds_with(1, true, Some(1))?; p.expect_end_with("checked out latest version of proposal (2 ahead 0 behind 'main'), replacing unpublished version (2 ahead 0 behind 'main')\r\n")?; @@ -1168,20 +1226,26 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; p.expect( "local proposal branch exists with 1 unpublished commits on top of the most up-to-date version of the proposal (3 ahead 0 behind 'main')\r\n", )?; - let mut c = p.expect_choice("", vec![ - format!("checkout proposal branch with 1 unpublished commits"), - format!("back"), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout proposal branch with 1 unpublished commits"), + format!("back"), + ], + )?; c.succeeds_with(0, true, Some(0))?; p.expect("checked out proposal branch with 1 unpublished commits (3 ahead 0 behind 'main')\r\n")?; p.expect_end()?; @@ -1244,20 +1308,26 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; p.expect( "local proposal branch exists with 1 unpublished commits on top of the most up-to-date version of the proposal (3 ahead 0 behind 'main')\r\n", )?; - let mut c = p.expect_choice("", vec![ - format!("checkout proposal branch with 1 unpublished commits"), - format!("back"), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout proposal branch with 1 unpublished commits"), + format!("back"), + ], + )?; c.succeeds_with(0, true, Some(0))?; p.expect("checked out proposal branch with 1 unpublished commits (3 ahead 0 behind 'main')\r\n")?; p.expect_end()?; @@ -1340,20 +1410,26 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; p.expect("updated proposal available (2 ahead 0 behind 'main'). existing version is 2 ahead 1 behind 'main'\r\n")?; - let mut c = p.expect_choice("", vec![ - format!("checkout and overwrite existing proposal branch"), - format!("checkout existing outdated proposal branch"), - format!("apply to current branch with `git am`"), - format!("download to ./patches"), - format!("back"), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout and overwrite existing proposal branch"), + format!("checkout existing outdated proposal branch"), + format!("apply to current branch with `git am`"), + format!("download to ./patches"), + format!("back"), + ], + )?; c.succeeds_with(0, true, Some(0))?; p.expect("checked out new version of proposal (2 ahead 0 behind 'main'), replacing old version (2 ahead 1 behind 'main')\r\n")?; p.expect_end()?; @@ -1407,20 +1483,26 @@ mod when_main_branch_is_uptodate { let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); p.expect("fetching updates...\r\n")?; p.expect_eventually("\r\n")?; // some updates listed here - let mut c = p.expect_choice("all proposals", vec![ - format!("\"{PROPOSAL_TITLE_3}\""), - format!("\"{PROPOSAL_TITLE_2}\""), - format!("\"{PROPOSAL_TITLE_1}\""), - ])?; + let mut c = p.expect_choice( + "all proposals", + vec![ + format!("\"{PROPOSAL_TITLE_3}\""), + format!("\"{PROPOSAL_TITLE_2}\""), + format!("\"{PROPOSAL_TITLE_1}\""), + ], + )?; c.succeeds_with(2, true, None)?; p.expect("updated proposal available (2 ahead 0 behind 'main'). existing version is 2 ahead 1 behind 'main'\r\n")?; - let mut c = p.expect_choice("", vec![ - format!("checkout and overwrite existing proposal branch"), - format!("checkout existing outdated proposal branch"), - format!("apply to current branch with `git am`"), - format!("download to ./patches"), - format!("back"), - ])?; + let mut c = p.expect_choice( + "", + vec![ + format!("checkout and overwrite existing proposal branch"), + format!("checkout existing outdated proposal branch"), + format!("apply to current branch with `git am`"), + format!("download to ./patches"), + format!("back"), + ], + )?; c.succeeds_with(0, true, Some(0))?; p.expect("checked out new version of proposal (2 ahead 0 behind 'main'), replacing old version (2 ahead 1 behind 'main')\r\n")?; p.expect_end()?; -- cgit v1.2.3