diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-07-16 11:01:44 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-07-16 11:01:44 +0100 |
| commit | 7704178c618f8ac455cd6b0582edb511a9e644c3 (patch) | |
| tree | 775e425f0af2543eb12e4a4b1d4feb022611368f /tests/ngit_list.rs | |
| parent | 8cea674f58e806c22d2887cff5e6f76bc4dba0db (diff) | |
| parent | ac53bca7e315848864ff9e51703720b5b466bc42 (diff) | |
Merge branch 'upgrade-dependancies'
Diffstat (limited to 'tests/ngit_list.rs')
| -rw-r--r-- | tests/ngit_list.rs | 378 |
1 files changed, 228 insertions, 150 deletions
diff --git a/tests/ngit_list.rs b/tests/ngit_list.rs index bb742cf..0547ad4 100644 --- a/tests/ngit_list.rs +++ b/tests/ngit_list.rs | |||
| @@ -201,11 +201,14 @@ mod when_main_branch_is_uptodate { | |||
| 201 | 201 | ||
| 202 | p.expect("fetching updates...\r\n")?; | 202 | p.expect("fetching updates...\r\n")?; |
| 203 | p.expect_eventually("\r\n")?; // some updates listed here | 203 | p.expect_eventually("\r\n")?; // some updates listed here |
| 204 | let mut c = p.expect_choice("all proposals", vec![ | 204 | let mut c = p.expect_choice( |
| 205 | format!("\"{PROPOSAL_TITLE_3}\""), | 205 | "all proposals", |
| 206 | format!("\"{PROPOSAL_TITLE_2}\""), | 206 | vec![ |
| 207 | format!("\"{PROPOSAL_TITLE_1}\""), | 207 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 208 | ])?; | 208 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 209 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 210 | ], | ||
| 211 | )?; | ||
| 209 | c.succeeds_with(2, true, None)?; | 212 | c.succeeds_with(2, true, None)?; |
| 210 | let mut c = p.expect_choice("", vec![ | 213 | let mut c = p.expect_choice("", vec![ |
| 211 | format!( | 214 | format!( |
| @@ -217,8 +220,7 @@ mod when_main_branch_is_uptodate { | |||
| 217 | ])?; | 220 | ])?; |
| 218 | c.succeeds_with(0, true, None)?; | 221 | c.succeeds_with(0, true, None)?; |
| 219 | p.expect(format!( | 222 | p.expect(format!( |
| 220 | "checked out proposal as 'pr/{}(", | 223 | "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_1}(", |
| 221 | FEATURE_BRANCH_NAME_1, | ||
| 222 | ))?; | 224 | ))?; |
| 223 | p.expect_end_eventually_with(")' branch\r\n")?; | 225 | p.expect_end_eventually_with(")' branch\r\n")?; |
| 224 | 226 | ||
| @@ -318,11 +320,14 @@ mod when_main_branch_is_uptodate { | |||
| 318 | 320 | ||
| 319 | p.expect("fetching updates...\r\n")?; | 321 | p.expect("fetching updates...\r\n")?; |
| 320 | p.expect_eventually("\r\n")?; // some updates listed here | 322 | p.expect_eventually("\r\n")?; // some updates listed here |
| 321 | let mut c = p.expect_choice("all proposals", vec![ | 323 | let mut c = p.expect_choice( |
| 322 | format!("\"{PROPOSAL_TITLE_3}\""), | 324 | "all proposals", |
| 323 | format!("\"{PROPOSAL_TITLE_2}\""), | 325 | vec![ |
| 324 | format!("\"{PROPOSAL_TITLE_1}\""), | 326 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 325 | ])?; | 327 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 328 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 329 | ], | ||
| 330 | )?; | ||
| 326 | c.succeeds_with(0, true, None)?; | 331 | c.succeeds_with(0, true, None)?; |
| 327 | let mut c = p.expect_choice("", vec![ | 332 | let mut c = p.expect_choice("", vec![ |
| 328 | format!( | 333 | format!( |
| @@ -334,8 +339,7 @@ mod when_main_branch_is_uptodate { | |||
| 334 | ])?; | 339 | ])?; |
| 335 | c.succeeds_with(0, true, Some(0))?; | 340 | c.succeeds_with(0, true, Some(0))?; |
| 336 | p.expect(format!( | 341 | p.expect(format!( |
| 337 | "checked out proposal as 'pr/{}(", | 342 | "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_3}(", |
| 338 | FEATURE_BRANCH_NAME_3, | ||
| 339 | ))?; | 343 | ))?; |
| 340 | p.expect_end_eventually_with(")' branch\r\n")?; | 344 | p.expect_end_eventually_with(")' branch\r\n")?; |
| 341 | 345 | ||
| @@ -438,12 +442,15 @@ mod when_main_branch_is_uptodate { | |||
| 438 | 442 | ||
| 439 | p.expect("fetching updates...\r\n")?; | 443 | p.expect("fetching updates...\r\n")?; |
| 440 | p.expect_eventually("\r\n")?; // some updates listed here | 444 | p.expect_eventually("\r\n")?; // some updates listed here |
| 441 | let mut c = p.expect_choice("all proposals", vec![ | 445 | let mut c = p.expect_choice( |
| 442 | format!("add d3.md"), // commit msg title | 446 | "all proposals", |
| 443 | format!("\"{PROPOSAL_TITLE_3}\""), | 447 | vec![ |
| 444 | format!("\"{PROPOSAL_TITLE_2}\""), | 448 | format!("add d3.md"), // commit msg title |
| 445 | format!("\"{PROPOSAL_TITLE_1}\""), | 449 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 446 | ])?; | 450 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 451 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 452 | ], | ||
| 453 | )?; | ||
| 447 | c.succeeds_with(0, true, None)?; | 454 | c.succeeds_with(0, true, None)?; |
| 448 | let mut c = p.expect_choice("", vec![ | 455 | let mut c = p.expect_choice("", vec![ |
| 449 | format!( | 456 | format!( |
| @@ -513,12 +520,15 @@ mod when_main_branch_is_uptodate { | |||
| 513 | 520 | ||
| 514 | p.expect("fetching updates...\r\n")?; | 521 | p.expect("fetching updates...\r\n")?; |
| 515 | p.expect_eventually("\r\n")?; // some updates listed here | 522 | p.expect_eventually("\r\n")?; // some updates listed here |
| 516 | let mut c = p.expect_choice("all proposals", vec![ | 523 | let mut c = p.expect_choice( |
| 517 | format!("add d3.md"), // commit msg title | 524 | "all proposals", |
| 518 | format!("\"{PROPOSAL_TITLE_3}\""), | 525 | vec![ |
| 519 | format!("\"{PROPOSAL_TITLE_2}\""), | 526 | format!("add d3.md"), // commit msg title |
| 520 | format!("\"{PROPOSAL_TITLE_1}\""), | 527 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 521 | ])?; | 528 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 529 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 530 | ], | ||
| 531 | )?; | ||
| 522 | c.succeeds_with(0, true, None)?; | 532 | c.succeeds_with(0, true, None)?; |
| 523 | let mut c = p.expect_choice("", vec![ | 533 | let mut c = p.expect_choice("", vec![ |
| 524 | format!( | 534 | format!( |
| @@ -530,8 +540,7 @@ mod when_main_branch_is_uptodate { | |||
| 530 | ])?; | 540 | ])?; |
| 531 | c.succeeds_with(0, true, Some(0))?; | 541 | c.succeeds_with(0, true, Some(0))?; |
| 532 | p.expect(format!( | 542 | p.expect(format!( |
| 533 | "checked out proposal as 'pr/{}(", | 543 | "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_4}(", |
| 534 | FEATURE_BRANCH_NAME_4, | ||
| 535 | ))?; | 544 | ))?; |
| 536 | p.expect_end_eventually_with(")' branch\r\n")?; | 545 | p.expect_end_eventually_with(")' branch\r\n")?; |
| 537 | 546 | ||
| @@ -633,11 +642,14 @@ mod when_main_branch_is_uptodate { | |||
| 633 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 642 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 634 | p.expect("fetching updates...\r\n")?; | 643 | p.expect("fetching updates...\r\n")?; |
| 635 | p.expect_eventually("\r\n")?; // some updates listed here | 644 | p.expect_eventually("\r\n")?; // some updates listed here |
| 636 | let mut c = p.expect_choice("all proposals", vec![ | 645 | let mut c = p.expect_choice( |
| 637 | format!("\"{PROPOSAL_TITLE_3}\""), | 646 | "all proposals", |
| 638 | format!("\"{PROPOSAL_TITLE_2}\""), | 647 | vec![ |
| 639 | format!("\"{PROPOSAL_TITLE_1}\""), | 648 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 640 | ])?; | 649 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 650 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 651 | ], | ||
| 652 | )?; | ||
| 641 | c.succeeds_with(2, true, None)?; | 653 | c.succeeds_with(2, true, None)?; |
| 642 | let mut c = p.expect_choice("", vec![ | 654 | let mut c = p.expect_choice("", vec![ |
| 643 | format!( | 655 | format!( |
| @@ -655,18 +667,24 @@ mod when_main_branch_is_uptodate { | |||
| 655 | p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 667 | p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 656 | p.expect("fetching updates...\r\n")?; | 668 | p.expect("fetching updates...\r\n")?; |
| 657 | p.expect_eventually("\r\n")?; // some updates listed here | 669 | p.expect_eventually("\r\n")?; // some updates listed here |
| 658 | let mut c = p.expect_choice("all proposals", vec![ | 670 | let mut c = p.expect_choice( |
| 659 | format!("\"{PROPOSAL_TITLE_3}\""), | 671 | "all proposals", |
| 660 | format!("\"{PROPOSAL_TITLE_2}\""), | 672 | vec![ |
| 661 | format!("\"{PROPOSAL_TITLE_1}\""), | 673 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 662 | ])?; | 674 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 675 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 676 | ], | ||
| 677 | )?; | ||
| 663 | c.succeeds_with(2, true, None)?; | 678 | c.succeeds_with(2, true, None)?; |
| 664 | let mut c = p.expect_choice("", vec![ | 679 | let mut c = p.expect_choice( |
| 665 | format!("checkout proposal branch (2 ahead 0 behind 'main')"), | 680 | "", |
| 666 | format!("apply to current branch with `git am`"), | 681 | vec![ |
| 667 | format!("download to ./patches"), | 682 | format!("checkout proposal branch (2 ahead 0 behind 'main')"), |
| 668 | format!("back"), | 683 | format!("apply to current branch with `git am`"), |
| 669 | ])?; | 684 | format!("download to ./patches"), |
| 685 | format!("back"), | ||
| 686 | ], | ||
| 687 | )?; | ||
| 670 | c.succeeds_with(0, true, Some(0))?; | 688 | c.succeeds_with(0, true, Some(0))?; |
| 671 | p.expect_end_eventually_and_print()?; | 689 | p.expect_end_eventually_and_print()?; |
| 672 | 690 | ||
| @@ -720,11 +738,14 @@ mod when_main_branch_is_uptodate { | |||
| 720 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 738 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 721 | p.expect("fetching updates...\r\n")?; | 739 | p.expect("fetching updates...\r\n")?; |
| 722 | p.expect_eventually("\r\n")?; // some updates listed here | 740 | p.expect_eventually("\r\n")?; // some updates listed here |
| 723 | let mut c = p.expect_choice("all proposals", vec![ | 741 | let mut c = p.expect_choice( |
| 724 | format!("\"{PROPOSAL_TITLE_3}\""), | 742 | "all proposals", |
| 725 | format!("\"{PROPOSAL_TITLE_2}\""), | 743 | vec![ |
| 726 | format!("\"{PROPOSAL_TITLE_1}\""), | 744 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 727 | ])?; | 745 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 746 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 747 | ], | ||
| 748 | )?; | ||
| 728 | c.succeeds_with(2, true, None)?; | 749 | c.succeeds_with(2, true, None)?; |
| 729 | let mut c = p.expect_choice("", vec![ | 750 | let mut c = p.expect_choice("", vec![ |
| 730 | format!( | 751 | format!( |
| @@ -742,22 +763,27 @@ mod when_main_branch_is_uptodate { | |||
| 742 | p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 763 | p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 743 | p.expect("fetching updates...\r\n")?; | 764 | p.expect("fetching updates...\r\n")?; |
| 744 | p.expect_eventually("\r\n")?; // some updates listed here | 765 | p.expect_eventually("\r\n")?; // some updates listed here |
| 745 | let mut c = p.expect_choice("all proposals", vec![ | 766 | let mut c = p.expect_choice( |
| 746 | format!("\"{PROPOSAL_TITLE_3}\""), | 767 | "all proposals", |
| 747 | format!("\"{PROPOSAL_TITLE_2}\""), | 768 | vec![ |
| 748 | format!("\"{PROPOSAL_TITLE_1}\""), | 769 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 749 | ])?; | 770 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 771 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 772 | ], | ||
| 773 | )?; | ||
| 750 | c.succeeds_with(2, true, None)?; | 774 | c.succeeds_with(2, true, None)?; |
| 751 | let mut c = p.expect_choice("", vec![ | 775 | let mut c = p.expect_choice( |
| 752 | format!("checkout proposal branch (2 ahead 0 behind 'main')"), | 776 | "", |
| 753 | format!("apply to current branch with `git am`"), | 777 | vec![ |
| 754 | format!("download to ./patches"), | 778 | format!("checkout proposal branch (2 ahead 0 behind 'main')"), |
| 755 | format!("back"), | 779 | format!("apply to current branch with `git am`"), |
| 756 | ])?; | 780 | format!("download to ./patches"), |
| 781 | format!("back"), | ||
| 782 | ], | ||
| 783 | )?; | ||
| 757 | c.succeeds_with(0, true, Some(0))?; | 784 | c.succeeds_with(0, true, Some(0))?; |
| 758 | p.expect(format!( | 785 | p.expect(format!( |
| 759 | "checked out proposal as 'pr/{}(", | 786 | "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_1}(", |
| 760 | FEATURE_BRANCH_NAME_1, | ||
| 761 | ))?; | 787 | ))?; |
| 762 | p.expect_end_eventually_with(")' branch\r\n")?; | 788 | p.expect_end_eventually_with(")' branch\r\n")?; |
| 763 | 789 | ||
| @@ -827,18 +853,24 @@ mod when_main_branch_is_uptodate { | |||
| 827 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 853 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 828 | p.expect("fetching updates...\r\n")?; | 854 | p.expect("fetching updates...\r\n")?; |
| 829 | p.expect_eventually("\r\n")?; // some updates listed here | 855 | p.expect_eventually("\r\n")?; // some updates listed here |
| 830 | let mut c = p.expect_choice("all proposals", vec![ | 856 | let mut c = p.expect_choice( |
| 831 | format!("\"{PROPOSAL_TITLE_3}\""), | 857 | "all proposals", |
| 832 | format!("\"{PROPOSAL_TITLE_2}\""), | 858 | vec![ |
| 833 | format!("\"{PROPOSAL_TITLE_1}\""), | 859 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 834 | ])?; | 860 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 861 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 862 | ], | ||
| 863 | )?; | ||
| 835 | c.succeeds_with(2, true, None)?; | 864 | c.succeeds_with(2, true, None)?; |
| 836 | let mut c = p.expect_choice("", vec![ | 865 | let mut c = p.expect_choice( |
| 837 | format!("checkout proposal branch and apply 1 appendments"), | 866 | "", |
| 838 | format!("apply to current branch with `git am`"), | 867 | vec![ |
| 839 | format!("download to ./patches"), | 868 | format!("checkout proposal branch and apply 1 appendments"), |
| 840 | format!("back"), | 869 | format!("apply to current branch with `git am`"), |
| 841 | ])?; | 870 | format!("download to ./patches"), |
| 871 | format!("back"), | ||
| 872 | ], | ||
| 873 | )?; | ||
| 842 | c.succeeds_with(0, true, Some(0))?; | 874 | c.succeeds_with(0, true, Some(0))?; |
| 843 | p.expect("checked out proposal branch and applied 1 appendments (2 ahead 0 behind 'main')\r\n")?; | 875 | p.expect("checked out proposal branch and applied 1 appendments (2 ahead 0 behind 'main')\r\n")?; |
| 844 | p.expect_end()?; | 876 | p.expect_end()?; |
| @@ -897,18 +929,24 @@ mod when_main_branch_is_uptodate { | |||
| 897 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 929 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 898 | p.expect("fetching updates...\r\n")?; | 930 | p.expect("fetching updates...\r\n")?; |
| 899 | p.expect_eventually("\r\n")?; // some updates listed here | 931 | p.expect_eventually("\r\n")?; // some updates listed here |
| 900 | let mut c = p.expect_choice("all proposals", vec![ | 932 | let mut c = p.expect_choice( |
| 901 | format!("\"{PROPOSAL_TITLE_3}\""), | 933 | "all proposals", |
| 902 | format!("\"{PROPOSAL_TITLE_2}\""), | 934 | vec![ |
| 903 | format!("\"{PROPOSAL_TITLE_1}\""), | 935 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 904 | ])?; | 936 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 937 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 938 | ], | ||
| 939 | )?; | ||
| 905 | c.succeeds_with(2, true, None)?; | 940 | c.succeeds_with(2, true, None)?; |
| 906 | let mut c = p.expect_choice("", vec![ | 941 | let mut c = p.expect_choice( |
| 907 | format!("checkout proposal branch and apply 1 appendments"), | 942 | "", |
| 908 | format!("apply to current branch with `git am`"), | 943 | vec![ |
| 909 | format!("download to ./patches"), | 944 | format!("checkout proposal branch and apply 1 appendments"), |
| 910 | format!("back"), | 945 | format!("apply to current branch with `git am`"), |
| 911 | ])?; | 946 | format!("download to ./patches"), |
| 947 | format!("back"), | ||
| 948 | ], | ||
| 949 | )?; | ||
| 912 | c.succeeds_with(0, true, Some(0))?; | 950 | c.succeeds_with(0, true, Some(0))?; |
| 913 | p.expect("checked out proposal branch and applied 1 appendments (2 ahead 0 behind 'main')\r\n")?; | 951 | p.expect("checked out proposal branch and applied 1 appendments (2 ahead 0 behind 'main')\r\n")?; |
| 914 | p.expect_end()?; | 952 | p.expect_end()?; |
| @@ -1004,21 +1042,29 @@ mod when_main_branch_is_uptodate { | |||
| 1004 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1042 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1005 | p.expect("fetching updates...\r\n")?; | 1043 | p.expect("fetching updates...\r\n")?; |
| 1006 | p.expect_eventually("\r\n")?; // some updates listed here | 1044 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1007 | let mut c = p.expect_choice("all proposals", vec![ | 1045 | let mut c = p.expect_choice( |
| 1008 | format!("\"{PROPOSAL_TITLE_3}\""), | 1046 | "all proposals", |
| 1009 | format!("\"{PROPOSAL_TITLE_2}\""), | 1047 | vec![ |
| 1010 | format!("\"{PROPOSAL_TITLE_1}\""), | 1048 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1011 | ])?; | 1049 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1050 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1051 | ], | ||
| 1052 | )?; | ||
| 1012 | c.succeeds_with(2, true, None)?; | 1053 | c.succeeds_with(2, true, None)?; |
| 1013 | p.expect_eventually("--force`\r\n")?; | 1054 | p.expect_eventually("--force`\r\n")?; |
| 1014 | 1055 | ||
| 1015 | let mut c = p.expect_choice("", vec![ | 1056 | let mut c = p.expect_choice( |
| 1016 | format!("checkout local branch with unpublished changes"), | 1057 | "", |
| 1017 | format!("discard unpublished changes and checkout new revision"), | 1058 | vec![ |
| 1018 | format!("apply to current branch with `git am`"), | 1059 | format!("checkout local branch with unpublished changes"), |
| 1019 | format!("download to ./patches"), | 1060 | format!( |
| 1020 | "back".to_string(), | 1061 | "discard unpublished changes and checkout new revision" |
| 1021 | ])?; | 1062 | ), |
| 1063 | format!("apply to current branch with `git am`"), | ||
| 1064 | format!("download to ./patches"), | ||
| 1065 | "back".to_string(), | ||
| 1066 | ], | ||
| 1067 | )?; | ||
| 1022 | c.succeeds_with(1, true, Some(0))?; | 1068 | c.succeeds_with(1, true, Some(0))?; |
| 1023 | 1069 | ||
| 1024 | p.expect_end_eventually_and_print()?; | 1070 | p.expect_end_eventually_and_print()?; |
| @@ -1075,11 +1121,14 @@ mod when_main_branch_is_uptodate { | |||
| 1075 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1121 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1076 | p.expect("fetching updates...\r\n")?; | 1122 | p.expect("fetching updates...\r\n")?; |
| 1077 | p.expect_eventually("\r\n")?; // some updates listed here | 1123 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1078 | let mut c = p.expect_choice("all proposals", vec![ | 1124 | let mut c = p.expect_choice( |
| 1079 | format!("\"{PROPOSAL_TITLE_3}\""), | 1125 | "all proposals", |
| 1080 | format!("\"{PROPOSAL_TITLE_2}\""), | 1126 | vec![ |
| 1081 | format!("\"{PROPOSAL_TITLE_1}\""), | 1127 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1082 | ])?; | 1128 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1129 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1130 | ], | ||
| 1131 | )?; | ||
| 1083 | c.succeeds_with(2, true, None)?; | 1132 | c.succeeds_with(2, true, None)?; |
| 1084 | p.expect("you have an amended/rebase version the proposal that is unpublished\r\n")?; | 1133 | p.expect("you have an amended/rebase version the proposal that is unpublished\r\n")?; |
| 1085 | 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")?; | 1134 | 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")?; |
| @@ -1088,13 +1137,18 @@ mod when_main_branch_is_uptodate { | |||
| 1088 | p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?; | 1137 | p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?; |
| 1089 | p.expect("if you are confident in your changes consider running `ngit push --force`\r\n")?; | 1138 | p.expect("if you are confident in your changes consider running `ngit push --force`\r\n")?; |
| 1090 | 1139 | ||
| 1091 | let mut c = p.expect_choice("", vec![ | 1140 | let mut c = p.expect_choice( |
| 1092 | format!("checkout local branch with unpublished changes"), | 1141 | "", |
| 1093 | format!("discard unpublished changes and checkout new revision"), | 1142 | vec![ |
| 1094 | format!("apply to current branch with `git am`"), | 1143 | format!("checkout local branch with unpublished changes"), |
| 1095 | format!("download to ./patches"), | 1144 | format!( |
| 1096 | "back".to_string(), | 1145 | "discard unpublished changes and checkout new revision" |
| 1097 | ])?; | 1146 | ), |
| 1147 | format!("apply to current branch with `git am`"), | ||
| 1148 | format!("download to ./patches"), | ||
| 1149 | "back".to_string(), | ||
| 1150 | ], | ||
| 1151 | )?; | ||
| 1098 | c.succeeds_with(1, true, Some(1))?; | 1152 | c.succeeds_with(1, true, Some(1))?; |
| 1099 | 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")?; | 1153 | 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")?; |
| 1100 | 1154 | ||
| @@ -1172,20 +1226,26 @@ mod when_main_branch_is_uptodate { | |||
| 1172 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1226 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1173 | p.expect("fetching updates...\r\n")?; | 1227 | p.expect("fetching updates...\r\n")?; |
| 1174 | p.expect_eventually("\r\n")?; // some updates listed here | 1228 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1175 | let mut c = p.expect_choice("all proposals", vec![ | 1229 | let mut c = p.expect_choice( |
| 1176 | format!("\"{PROPOSAL_TITLE_3}\""), | 1230 | "all proposals", |
| 1177 | format!("\"{PROPOSAL_TITLE_2}\""), | 1231 | vec![ |
| 1178 | format!("\"{PROPOSAL_TITLE_1}\""), | 1232 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1179 | ])?; | 1233 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1234 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1235 | ], | ||
| 1236 | )?; | ||
| 1180 | c.succeeds_with(2, true, None)?; | 1237 | c.succeeds_with(2, true, None)?; |
| 1181 | p.expect( | 1238 | p.expect( |
| 1182 | "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", | 1239 | "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", |
| 1183 | )?; | 1240 | )?; |
| 1184 | 1241 | ||
| 1185 | let mut c = p.expect_choice("", vec![ | 1242 | let mut c = p.expect_choice( |
| 1186 | format!("checkout proposal branch with 1 unpublished commits"), | 1243 | "", |
| 1187 | format!("back"), | 1244 | vec![ |
| 1188 | ])?; | 1245 | format!("checkout proposal branch with 1 unpublished commits"), |
| 1246 | format!("back"), | ||
| 1247 | ], | ||
| 1248 | )?; | ||
| 1189 | c.succeeds_with(0, true, Some(0))?; | 1249 | c.succeeds_with(0, true, Some(0))?; |
| 1190 | p.expect("checked out proposal branch with 1 unpublished commits (3 ahead 0 behind 'main')\r\n")?; | 1250 | p.expect("checked out proposal branch with 1 unpublished commits (3 ahead 0 behind 'main')\r\n")?; |
| 1191 | p.expect_end()?; | 1251 | p.expect_end()?; |
| @@ -1248,20 +1308,26 @@ mod when_main_branch_is_uptodate { | |||
| 1248 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1308 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1249 | p.expect("fetching updates...\r\n")?; | 1309 | p.expect("fetching updates...\r\n")?; |
| 1250 | p.expect_eventually("\r\n")?; // some updates listed here | 1310 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1251 | let mut c = p.expect_choice("all proposals", vec![ | 1311 | let mut c = p.expect_choice( |
| 1252 | format!("\"{PROPOSAL_TITLE_3}\""), | 1312 | "all proposals", |
| 1253 | format!("\"{PROPOSAL_TITLE_2}\""), | 1313 | vec![ |
| 1254 | format!("\"{PROPOSAL_TITLE_1}\""), | 1314 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1255 | ])?; | 1315 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1316 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1317 | ], | ||
| 1318 | )?; | ||
| 1256 | c.succeeds_with(2, true, None)?; | 1319 | c.succeeds_with(2, true, None)?; |
| 1257 | p.expect( | 1320 | p.expect( |
| 1258 | "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", | 1321 | "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", |
| 1259 | )?; | 1322 | )?; |
| 1260 | 1323 | ||
| 1261 | let mut c = p.expect_choice("", vec![ | 1324 | let mut c = p.expect_choice( |
| 1262 | format!("checkout proposal branch with 1 unpublished commits"), | 1325 | "", |
| 1263 | format!("back"), | 1326 | vec![ |
| 1264 | ])?; | 1327 | format!("checkout proposal branch with 1 unpublished commits"), |
| 1328 | format!("back"), | ||
| 1329 | ], | ||
| 1330 | )?; | ||
| 1265 | c.succeeds_with(0, true, Some(0))?; | 1331 | c.succeeds_with(0, true, Some(0))?; |
| 1266 | p.expect("checked out proposal branch with 1 unpublished commits (3 ahead 0 behind 'main')\r\n")?; | 1332 | p.expect("checked out proposal branch with 1 unpublished commits (3 ahead 0 behind 'main')\r\n")?; |
| 1267 | p.expect_end()?; | 1333 | p.expect_end()?; |
| @@ -1344,20 +1410,26 @@ mod when_main_branch_is_uptodate { | |||
| 1344 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1410 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1345 | p.expect("fetching updates...\r\n")?; | 1411 | p.expect("fetching updates...\r\n")?; |
| 1346 | p.expect_eventually("\r\n")?; // some updates listed here | 1412 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1347 | let mut c = p.expect_choice("all proposals", vec![ | 1413 | let mut c = p.expect_choice( |
| 1348 | format!("\"{PROPOSAL_TITLE_3}\""), | 1414 | "all proposals", |
| 1349 | format!("\"{PROPOSAL_TITLE_2}\""), | 1415 | vec![ |
| 1350 | format!("\"{PROPOSAL_TITLE_1}\""), | 1416 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1351 | ])?; | 1417 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1418 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1419 | ], | ||
| 1420 | )?; | ||
| 1352 | c.succeeds_with(2, true, None)?; | 1421 | c.succeeds_with(2, true, None)?; |
| 1353 | p.expect("updated proposal available (2 ahead 0 behind 'main'). existing version is 2 ahead 1 behind 'main'\r\n")?; | 1422 | p.expect("updated proposal available (2 ahead 0 behind 'main'). existing version is 2 ahead 1 behind 'main'\r\n")?; |
| 1354 | let mut c = p.expect_choice("", vec![ | 1423 | let mut c = p.expect_choice( |
| 1355 | format!("checkout and overwrite existing proposal branch"), | 1424 | "", |
| 1356 | format!("checkout existing outdated proposal branch"), | 1425 | vec![ |
| 1357 | format!("apply to current branch with `git am`"), | 1426 | format!("checkout and overwrite existing proposal branch"), |
| 1358 | format!("download to ./patches"), | 1427 | format!("checkout existing outdated proposal branch"), |
| 1359 | format!("back"), | 1428 | format!("apply to current branch with `git am`"), |
| 1360 | ])?; | 1429 | format!("download to ./patches"), |
| 1430 | format!("back"), | ||
| 1431 | ], | ||
| 1432 | )?; | ||
| 1361 | c.succeeds_with(0, true, Some(0))?; | 1433 | c.succeeds_with(0, true, Some(0))?; |
| 1362 | p.expect("checked out new version of proposal (2 ahead 0 behind 'main'), replacing old version (2 ahead 1 behind 'main')\r\n")?; | 1434 | p.expect("checked out new version of proposal (2 ahead 0 behind 'main'), replacing old version (2 ahead 1 behind 'main')\r\n")?; |
| 1363 | p.expect_end()?; | 1435 | p.expect_end()?; |
| @@ -1411,20 +1483,26 @@ mod when_main_branch_is_uptodate { | |||
| 1411 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1483 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1412 | p.expect("fetching updates...\r\n")?; | 1484 | p.expect("fetching updates...\r\n")?; |
| 1413 | p.expect_eventually("\r\n")?; // some updates listed here | 1485 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1414 | let mut c = p.expect_choice("all proposals", vec![ | 1486 | let mut c = p.expect_choice( |
| 1415 | format!("\"{PROPOSAL_TITLE_3}\""), | 1487 | "all proposals", |
| 1416 | format!("\"{PROPOSAL_TITLE_2}\""), | 1488 | vec![ |
| 1417 | format!("\"{PROPOSAL_TITLE_1}\""), | 1489 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1418 | ])?; | 1490 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1491 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1492 | ], | ||
| 1493 | )?; | ||
| 1419 | c.succeeds_with(2, true, None)?; | 1494 | c.succeeds_with(2, true, None)?; |
| 1420 | p.expect("updated proposal available (2 ahead 0 behind 'main'). existing version is 2 ahead 1 behind 'main'\r\n")?; | 1495 | p.expect("updated proposal available (2 ahead 0 behind 'main'). existing version is 2 ahead 1 behind 'main'\r\n")?; |
| 1421 | let mut c = p.expect_choice("", vec![ | 1496 | let mut c = p.expect_choice( |
| 1422 | format!("checkout and overwrite existing proposal branch"), | 1497 | "", |
| 1423 | format!("checkout existing outdated proposal branch"), | 1498 | vec![ |
| 1424 | format!("apply to current branch with `git am`"), | 1499 | format!("checkout and overwrite existing proposal branch"), |
| 1425 | format!("download to ./patches"), | 1500 | format!("checkout existing outdated proposal branch"), |
| 1426 | format!("back"), | 1501 | format!("apply to current branch with `git am`"), |
| 1427 | ])?; | 1502 | format!("download to ./patches"), |
| 1503 | format!("back"), | ||
| 1504 | ], | ||
| 1505 | )?; | ||
| 1428 | c.succeeds_with(0, true, Some(0))?; | 1506 | c.succeeds_with(0, true, Some(0))?; |
| 1429 | p.expect("checked out new version of proposal (2 ahead 0 behind 'main'), replacing old version (2 ahead 1 behind 'main')\r\n")?; | 1507 | p.expect("checked out new version of proposal (2 ahead 0 behind 'main'), replacing old version (2 ahead 1 behind 'main')\r\n")?; |
| 1430 | p.expect_end()?; | 1508 | p.expect_end()?; |