diff options
Diffstat (limited to 'tests/ngit_list.rs')
| -rw-r--r-- | tests/ngit_list.rs | 366 |
1 files changed, 224 insertions, 142 deletions
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 { | |||
| 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!( |
| @@ -317,11 +320,14 @@ mod when_main_branch_is_uptodate { | |||
| 317 | 320 | ||
| 318 | p.expect("fetching updates...\r\n")?; | 321 | p.expect("fetching updates...\r\n")?; |
| 319 | p.expect_eventually("\r\n")?; // some updates listed here | 322 | p.expect_eventually("\r\n")?; // some updates listed here |
| 320 | let mut c = p.expect_choice("all proposals", vec![ | 323 | let mut c = p.expect_choice( |
| 321 | format!("\"{PROPOSAL_TITLE_3}\""), | 324 | "all proposals", |
| 322 | format!("\"{PROPOSAL_TITLE_2}\""), | 325 | vec![ |
| 323 | format!("\"{PROPOSAL_TITLE_1}\""), | 326 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 324 | ])?; | 327 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 328 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 329 | ], | ||
| 330 | )?; | ||
| 325 | c.succeeds_with(0, true, None)?; | 331 | c.succeeds_with(0, true, None)?; |
| 326 | let mut c = p.expect_choice("", vec![ | 332 | let mut c = p.expect_choice("", vec![ |
| 327 | format!( | 333 | format!( |
| @@ -436,12 +442,15 @@ mod when_main_branch_is_uptodate { | |||
| 436 | 442 | ||
| 437 | p.expect("fetching updates...\r\n")?; | 443 | p.expect("fetching updates...\r\n")?; |
| 438 | p.expect_eventually("\r\n")?; // some updates listed here | 444 | p.expect_eventually("\r\n")?; // some updates listed here |
| 439 | let mut c = p.expect_choice("all proposals", vec![ | 445 | let mut c = p.expect_choice( |
| 440 | format!("add d3.md"), // commit msg title | 446 | "all proposals", |
| 441 | format!("\"{PROPOSAL_TITLE_3}\""), | 447 | vec![ |
| 442 | format!("\"{PROPOSAL_TITLE_2}\""), | 448 | format!("add d3.md"), // commit msg title |
| 443 | format!("\"{PROPOSAL_TITLE_1}\""), | 449 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 444 | ])?; | 450 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 451 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 452 | ], | ||
| 453 | )?; | ||
| 445 | c.succeeds_with(0, true, None)?; | 454 | c.succeeds_with(0, true, None)?; |
| 446 | let mut c = p.expect_choice("", vec![ | 455 | let mut c = p.expect_choice("", vec![ |
| 447 | format!( | 456 | format!( |
| @@ -511,12 +520,15 @@ mod when_main_branch_is_uptodate { | |||
| 511 | 520 | ||
| 512 | p.expect("fetching updates...\r\n")?; | 521 | p.expect("fetching updates...\r\n")?; |
| 513 | p.expect_eventually("\r\n")?; // some updates listed here | 522 | p.expect_eventually("\r\n")?; // some updates listed here |
| 514 | let mut c = p.expect_choice("all proposals", vec![ | 523 | let mut c = p.expect_choice( |
| 515 | format!("add d3.md"), // commit msg title | 524 | "all proposals", |
| 516 | format!("\"{PROPOSAL_TITLE_3}\""), | 525 | vec![ |
| 517 | format!("\"{PROPOSAL_TITLE_2}\""), | 526 | format!("add d3.md"), // commit msg title |
| 518 | format!("\"{PROPOSAL_TITLE_1}\""), | 527 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 519 | ])?; | 528 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 529 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 530 | ], | ||
| 531 | )?; | ||
| 520 | c.succeeds_with(0, true, None)?; | 532 | c.succeeds_with(0, true, None)?; |
| 521 | let mut c = p.expect_choice("", vec![ | 533 | let mut c = p.expect_choice("", vec![ |
| 522 | format!( | 534 | format!( |
| @@ -630,11 +642,14 @@ mod when_main_branch_is_uptodate { | |||
| 630 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 642 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 631 | p.expect("fetching updates...\r\n")?; | 643 | p.expect("fetching updates...\r\n")?; |
| 632 | p.expect_eventually("\r\n")?; // some updates listed here | 644 | p.expect_eventually("\r\n")?; // some updates listed here |
| 633 | let mut c = p.expect_choice("all proposals", vec![ | 645 | let mut c = p.expect_choice( |
| 634 | format!("\"{PROPOSAL_TITLE_3}\""), | 646 | "all proposals", |
| 635 | format!("\"{PROPOSAL_TITLE_2}\""), | 647 | vec![ |
| 636 | format!("\"{PROPOSAL_TITLE_1}\""), | 648 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 637 | ])?; | 649 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 650 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 651 | ], | ||
| 652 | )?; | ||
| 638 | c.succeeds_with(2, true, None)?; | 653 | c.succeeds_with(2, true, None)?; |
| 639 | let mut c = p.expect_choice("", vec![ | 654 | let mut c = p.expect_choice("", vec![ |
| 640 | format!( | 655 | format!( |
| @@ -652,18 +667,24 @@ mod when_main_branch_is_uptodate { | |||
| 652 | p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 667 | p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 653 | p.expect("fetching updates...\r\n")?; | 668 | p.expect("fetching updates...\r\n")?; |
| 654 | p.expect_eventually("\r\n")?; // some updates listed here | 669 | p.expect_eventually("\r\n")?; // some updates listed here |
| 655 | let mut c = p.expect_choice("all proposals", vec![ | 670 | let mut c = p.expect_choice( |
| 656 | format!("\"{PROPOSAL_TITLE_3}\""), | 671 | "all proposals", |
| 657 | format!("\"{PROPOSAL_TITLE_2}\""), | 672 | vec![ |
| 658 | format!("\"{PROPOSAL_TITLE_1}\""), | 673 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 659 | ])?; | 674 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 675 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 676 | ], | ||
| 677 | )?; | ||
| 660 | c.succeeds_with(2, true, None)?; | 678 | c.succeeds_with(2, true, None)?; |
| 661 | let mut c = p.expect_choice("", vec![ | 679 | let mut c = p.expect_choice( |
| 662 | format!("checkout proposal branch (2 ahead 0 behind 'main')"), | 680 | "", |
| 663 | format!("apply to current branch with `git am`"), | 681 | vec![ |
| 664 | format!("download to ./patches"), | 682 | format!("checkout proposal branch (2 ahead 0 behind 'main')"), |
| 665 | format!("back"), | 683 | format!("apply to current branch with `git am`"), |
| 666 | ])?; | 684 | format!("download to ./patches"), |
| 685 | format!("back"), | ||
| 686 | ], | ||
| 687 | )?; | ||
| 667 | c.succeeds_with(0, true, Some(0))?; | 688 | c.succeeds_with(0, true, Some(0))?; |
| 668 | p.expect_end_eventually_and_print()?; | 689 | p.expect_end_eventually_and_print()?; |
| 669 | 690 | ||
| @@ -717,11 +738,14 @@ mod when_main_branch_is_uptodate { | |||
| 717 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 738 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 718 | p.expect("fetching updates...\r\n")?; | 739 | p.expect("fetching updates...\r\n")?; |
| 719 | p.expect_eventually("\r\n")?; // some updates listed here | 740 | p.expect_eventually("\r\n")?; // some updates listed here |
| 720 | let mut c = p.expect_choice("all proposals", vec![ | 741 | let mut c = p.expect_choice( |
| 721 | format!("\"{PROPOSAL_TITLE_3}\""), | 742 | "all proposals", |
| 722 | format!("\"{PROPOSAL_TITLE_2}\""), | 743 | vec![ |
| 723 | format!("\"{PROPOSAL_TITLE_1}\""), | 744 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 724 | ])?; | 745 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 746 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 747 | ], | ||
| 748 | )?; | ||
| 725 | c.succeeds_with(2, true, None)?; | 749 | c.succeeds_with(2, true, None)?; |
| 726 | let mut c = p.expect_choice("", vec![ | 750 | let mut c = p.expect_choice("", vec![ |
| 727 | format!( | 751 | format!( |
| @@ -739,18 +763,24 @@ mod when_main_branch_is_uptodate { | |||
| 739 | p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 763 | p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 740 | p.expect("fetching updates...\r\n")?; | 764 | p.expect("fetching updates...\r\n")?; |
| 741 | p.expect_eventually("\r\n")?; // some updates listed here | 765 | p.expect_eventually("\r\n")?; // some updates listed here |
| 742 | let mut c = p.expect_choice("all proposals", vec![ | 766 | let mut c = p.expect_choice( |
| 743 | format!("\"{PROPOSAL_TITLE_3}\""), | 767 | "all proposals", |
| 744 | format!("\"{PROPOSAL_TITLE_2}\""), | 768 | vec![ |
| 745 | format!("\"{PROPOSAL_TITLE_1}\""), | 769 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 746 | ])?; | 770 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 771 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 772 | ], | ||
| 773 | )?; | ||
| 747 | c.succeeds_with(2, true, None)?; | 774 | c.succeeds_with(2, true, None)?; |
| 748 | let mut c = p.expect_choice("", vec![ | 775 | let mut c = p.expect_choice( |
| 749 | format!("checkout proposal branch (2 ahead 0 behind 'main')"), | 776 | "", |
| 750 | format!("apply to current branch with `git am`"), | 777 | vec![ |
| 751 | format!("download to ./patches"), | 778 | format!("checkout proposal branch (2 ahead 0 behind 'main')"), |
| 752 | format!("back"), | 779 | format!("apply to current branch with `git am`"), |
| 753 | ])?; | 780 | format!("download to ./patches"), |
| 781 | format!("back"), | ||
| 782 | ], | ||
| 783 | )?; | ||
| 754 | c.succeeds_with(0, true, Some(0))?; | 784 | c.succeeds_with(0, true, Some(0))?; |
| 755 | p.expect(format!( | 785 | p.expect(format!( |
| 756 | "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_1}(", | 786 | "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_1}(", |
| @@ -823,18 +853,24 @@ mod when_main_branch_is_uptodate { | |||
| 823 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 853 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 824 | p.expect("fetching updates...\r\n")?; | 854 | p.expect("fetching updates...\r\n")?; |
| 825 | p.expect_eventually("\r\n")?; // some updates listed here | 855 | p.expect_eventually("\r\n")?; // some updates listed here |
| 826 | let mut c = p.expect_choice("all proposals", vec![ | 856 | let mut c = p.expect_choice( |
| 827 | format!("\"{PROPOSAL_TITLE_3}\""), | 857 | "all proposals", |
| 828 | format!("\"{PROPOSAL_TITLE_2}\""), | 858 | vec![ |
| 829 | format!("\"{PROPOSAL_TITLE_1}\""), | 859 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 830 | ])?; | 860 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 861 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 862 | ], | ||
| 863 | )?; | ||
| 831 | c.succeeds_with(2, true, None)?; | 864 | c.succeeds_with(2, true, None)?; |
| 832 | let mut c = p.expect_choice("", vec![ | 865 | let mut c = p.expect_choice( |
| 833 | format!("checkout proposal branch and apply 1 appendments"), | 866 | "", |
| 834 | format!("apply to current branch with `git am`"), | 867 | vec![ |
| 835 | format!("download to ./patches"), | 868 | format!("checkout proposal branch and apply 1 appendments"), |
| 836 | format!("back"), | 869 | format!("apply to current branch with `git am`"), |
| 837 | ])?; | 870 | format!("download to ./patches"), |
| 871 | format!("back"), | ||
| 872 | ], | ||
| 873 | )?; | ||
| 838 | c.succeeds_with(0, true, Some(0))?; | 874 | c.succeeds_with(0, true, Some(0))?; |
| 839 | 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")?; |
| 840 | p.expect_end()?; | 876 | p.expect_end()?; |
| @@ -893,18 +929,24 @@ mod when_main_branch_is_uptodate { | |||
| 893 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 929 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 894 | p.expect("fetching updates...\r\n")?; | 930 | p.expect("fetching updates...\r\n")?; |
| 895 | p.expect_eventually("\r\n")?; // some updates listed here | 931 | p.expect_eventually("\r\n")?; // some updates listed here |
| 896 | let mut c = p.expect_choice("all proposals", vec![ | 932 | let mut c = p.expect_choice( |
| 897 | format!("\"{PROPOSAL_TITLE_3}\""), | 933 | "all proposals", |
| 898 | format!("\"{PROPOSAL_TITLE_2}\""), | 934 | vec![ |
| 899 | format!("\"{PROPOSAL_TITLE_1}\""), | 935 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 900 | ])?; | 936 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 937 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 938 | ], | ||
| 939 | )?; | ||
| 901 | c.succeeds_with(2, true, None)?; | 940 | c.succeeds_with(2, true, None)?; |
| 902 | let mut c = p.expect_choice("", vec![ | 941 | let mut c = p.expect_choice( |
| 903 | format!("checkout proposal branch and apply 1 appendments"), | 942 | "", |
| 904 | format!("apply to current branch with `git am`"), | 943 | vec![ |
| 905 | format!("download to ./patches"), | 944 | format!("checkout proposal branch and apply 1 appendments"), |
| 906 | format!("back"), | 945 | format!("apply to current branch with `git am`"), |
| 907 | ])?; | 946 | format!("download to ./patches"), |
| 947 | format!("back"), | ||
| 948 | ], | ||
| 949 | )?; | ||
| 908 | c.succeeds_with(0, true, Some(0))?; | 950 | c.succeeds_with(0, true, Some(0))?; |
| 909 | 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")?; |
| 910 | p.expect_end()?; | 952 | p.expect_end()?; |
| @@ -1000,21 +1042,29 @@ mod when_main_branch_is_uptodate { | |||
| 1000 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1042 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1001 | p.expect("fetching updates...\r\n")?; | 1043 | p.expect("fetching updates...\r\n")?; |
| 1002 | p.expect_eventually("\r\n")?; // some updates listed here | 1044 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1003 | let mut c = p.expect_choice("all proposals", vec![ | 1045 | let mut c = p.expect_choice( |
| 1004 | format!("\"{PROPOSAL_TITLE_3}\""), | 1046 | "all proposals", |
| 1005 | format!("\"{PROPOSAL_TITLE_2}\""), | 1047 | vec![ |
| 1006 | format!("\"{PROPOSAL_TITLE_1}\""), | 1048 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1007 | ])?; | 1049 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1050 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1051 | ], | ||
| 1052 | )?; | ||
| 1008 | c.succeeds_with(2, true, None)?; | 1053 | c.succeeds_with(2, true, None)?; |
| 1009 | p.expect_eventually("--force`\r\n")?; | 1054 | p.expect_eventually("--force`\r\n")?; |
| 1010 | 1055 | ||
| 1011 | let mut c = p.expect_choice("", vec![ | 1056 | let mut c = p.expect_choice( |
| 1012 | format!("checkout local branch with unpublished changes"), | 1057 | "", |
| 1013 | format!("discard unpublished changes and checkout new revision"), | 1058 | vec![ |
| 1014 | format!("apply to current branch with `git am`"), | 1059 | format!("checkout local branch with unpublished changes"), |
| 1015 | format!("download to ./patches"), | 1060 | format!( |
| 1016 | "back".to_string(), | 1061 | "discard unpublished changes and checkout new revision" |
| 1017 | ])?; | 1062 | ), |
| 1063 | format!("apply to current branch with `git am`"), | ||
| 1064 | format!("download to ./patches"), | ||
| 1065 | "back".to_string(), | ||
| 1066 | ], | ||
| 1067 | )?; | ||
| 1018 | c.succeeds_with(1, true, Some(0))?; | 1068 | c.succeeds_with(1, true, Some(0))?; |
| 1019 | 1069 | ||
| 1020 | p.expect_end_eventually_and_print()?; | 1070 | p.expect_end_eventually_and_print()?; |
| @@ -1071,11 +1121,14 @@ mod when_main_branch_is_uptodate { | |||
| 1071 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1121 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1072 | p.expect("fetching updates...\r\n")?; | 1122 | p.expect("fetching updates...\r\n")?; |
| 1073 | p.expect_eventually("\r\n")?; // some updates listed here | 1123 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1074 | let mut c = p.expect_choice("all proposals", vec![ | 1124 | let mut c = p.expect_choice( |
| 1075 | format!("\"{PROPOSAL_TITLE_3}\""), | 1125 | "all proposals", |
| 1076 | format!("\"{PROPOSAL_TITLE_2}\""), | 1126 | vec![ |
| 1077 | format!("\"{PROPOSAL_TITLE_1}\""), | 1127 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1078 | ])?; | 1128 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1129 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1130 | ], | ||
| 1131 | )?; | ||
| 1079 | c.succeeds_with(2, true, None)?; | 1132 | c.succeeds_with(2, true, None)?; |
| 1080 | 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")?; |
| 1081 | 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")?; |
| @@ -1084,13 +1137,18 @@ mod when_main_branch_is_uptodate { | |||
| 1084 | 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")?; |
| 1085 | 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")?; |
| 1086 | 1139 | ||
| 1087 | let mut c = p.expect_choice("", vec![ | 1140 | let mut c = p.expect_choice( |
| 1088 | format!("checkout local branch with unpublished changes"), | 1141 | "", |
| 1089 | format!("discard unpublished changes and checkout new revision"), | 1142 | vec![ |
| 1090 | format!("apply to current branch with `git am`"), | 1143 | format!("checkout local branch with unpublished changes"), |
| 1091 | format!("download to ./patches"), | 1144 | format!( |
| 1092 | "back".to_string(), | 1145 | "discard unpublished changes and checkout new revision" |
| 1093 | ])?; | 1146 | ), |
| 1147 | format!("apply to current branch with `git am`"), | ||
| 1148 | format!("download to ./patches"), | ||
| 1149 | "back".to_string(), | ||
| 1150 | ], | ||
| 1151 | )?; | ||
| 1094 | c.succeeds_with(1, true, Some(1))?; | 1152 | c.succeeds_with(1, true, Some(1))?; |
| 1095 | 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")?; |
| 1096 | 1154 | ||
| @@ -1168,20 +1226,26 @@ mod when_main_branch_is_uptodate { | |||
| 1168 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1226 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1169 | p.expect("fetching updates...\r\n")?; | 1227 | p.expect("fetching updates...\r\n")?; |
| 1170 | p.expect_eventually("\r\n")?; // some updates listed here | 1228 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1171 | let mut c = p.expect_choice("all proposals", vec![ | 1229 | let mut c = p.expect_choice( |
| 1172 | format!("\"{PROPOSAL_TITLE_3}\""), | 1230 | "all proposals", |
| 1173 | format!("\"{PROPOSAL_TITLE_2}\""), | 1231 | vec![ |
| 1174 | format!("\"{PROPOSAL_TITLE_1}\""), | 1232 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1175 | ])?; | 1233 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1234 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1235 | ], | ||
| 1236 | )?; | ||
| 1176 | c.succeeds_with(2, true, None)?; | 1237 | c.succeeds_with(2, true, None)?; |
| 1177 | p.expect( | 1238 | p.expect( |
| 1178 | "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", |
| 1179 | )?; | 1240 | )?; |
| 1180 | 1241 | ||
| 1181 | let mut c = p.expect_choice("", vec![ | 1242 | let mut c = p.expect_choice( |
| 1182 | format!("checkout proposal branch with 1 unpublished commits"), | 1243 | "", |
| 1183 | format!("back"), | 1244 | vec![ |
| 1184 | ])?; | 1245 | format!("checkout proposal branch with 1 unpublished commits"), |
| 1246 | format!("back"), | ||
| 1247 | ], | ||
| 1248 | )?; | ||
| 1185 | c.succeeds_with(0, true, Some(0))?; | 1249 | c.succeeds_with(0, true, Some(0))?; |
| 1186 | 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")?; |
| 1187 | p.expect_end()?; | 1251 | p.expect_end()?; |
| @@ -1244,20 +1308,26 @@ mod when_main_branch_is_uptodate { | |||
| 1244 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1308 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1245 | p.expect("fetching updates...\r\n")?; | 1309 | p.expect("fetching updates...\r\n")?; |
| 1246 | p.expect_eventually("\r\n")?; // some updates listed here | 1310 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1247 | let mut c = p.expect_choice("all proposals", vec![ | 1311 | let mut c = p.expect_choice( |
| 1248 | format!("\"{PROPOSAL_TITLE_3}\""), | 1312 | "all proposals", |
| 1249 | format!("\"{PROPOSAL_TITLE_2}\""), | 1313 | vec![ |
| 1250 | format!("\"{PROPOSAL_TITLE_1}\""), | 1314 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1251 | ])?; | 1315 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1316 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1317 | ], | ||
| 1318 | )?; | ||
| 1252 | c.succeeds_with(2, true, None)?; | 1319 | c.succeeds_with(2, true, None)?; |
| 1253 | p.expect( | 1320 | p.expect( |
| 1254 | "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", |
| 1255 | )?; | 1322 | )?; |
| 1256 | 1323 | ||
| 1257 | let mut c = p.expect_choice("", vec![ | 1324 | let mut c = p.expect_choice( |
| 1258 | format!("checkout proposal branch with 1 unpublished commits"), | 1325 | "", |
| 1259 | format!("back"), | 1326 | vec![ |
| 1260 | ])?; | 1327 | format!("checkout proposal branch with 1 unpublished commits"), |
| 1328 | format!("back"), | ||
| 1329 | ], | ||
| 1330 | )?; | ||
| 1261 | c.succeeds_with(0, true, Some(0))?; | 1331 | c.succeeds_with(0, true, Some(0))?; |
| 1262 | 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")?; |
| 1263 | p.expect_end()?; | 1333 | p.expect_end()?; |
| @@ -1340,20 +1410,26 @@ mod when_main_branch_is_uptodate { | |||
| 1340 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1410 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1341 | p.expect("fetching updates...\r\n")?; | 1411 | p.expect("fetching updates...\r\n")?; |
| 1342 | p.expect_eventually("\r\n")?; // some updates listed here | 1412 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1343 | let mut c = p.expect_choice("all proposals", vec![ | 1413 | let mut c = p.expect_choice( |
| 1344 | format!("\"{PROPOSAL_TITLE_3}\""), | 1414 | "all proposals", |
| 1345 | format!("\"{PROPOSAL_TITLE_2}\""), | 1415 | vec![ |
| 1346 | format!("\"{PROPOSAL_TITLE_1}\""), | 1416 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1347 | ])?; | 1417 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1418 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1419 | ], | ||
| 1420 | )?; | ||
| 1348 | c.succeeds_with(2, true, None)?; | 1421 | c.succeeds_with(2, true, None)?; |
| 1349 | 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")?; |
| 1350 | let mut c = p.expect_choice("", vec![ | 1423 | let mut c = p.expect_choice( |
| 1351 | format!("checkout and overwrite existing proposal branch"), | 1424 | "", |
| 1352 | format!("checkout existing outdated proposal branch"), | 1425 | vec![ |
| 1353 | format!("apply to current branch with `git am`"), | 1426 | format!("checkout and overwrite existing proposal branch"), |
| 1354 | format!("download to ./patches"), | 1427 | format!("checkout existing outdated proposal branch"), |
| 1355 | format!("back"), | 1428 | format!("apply to current branch with `git am`"), |
| 1356 | ])?; | 1429 | format!("download to ./patches"), |
| 1430 | format!("back"), | ||
| 1431 | ], | ||
| 1432 | )?; | ||
| 1357 | c.succeeds_with(0, true, Some(0))?; | 1433 | c.succeeds_with(0, true, Some(0))?; |
| 1358 | 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")?; |
| 1359 | p.expect_end()?; | 1435 | p.expect_end()?; |
| @@ -1407,20 +1483,26 @@ mod when_main_branch_is_uptodate { | |||
| 1407 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); | 1483 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); |
| 1408 | p.expect("fetching updates...\r\n")?; | 1484 | p.expect("fetching updates...\r\n")?; |
| 1409 | p.expect_eventually("\r\n")?; // some updates listed here | 1485 | p.expect_eventually("\r\n")?; // some updates listed here |
| 1410 | let mut c = p.expect_choice("all proposals", vec![ | 1486 | let mut c = p.expect_choice( |
| 1411 | format!("\"{PROPOSAL_TITLE_3}\""), | 1487 | "all proposals", |
| 1412 | format!("\"{PROPOSAL_TITLE_2}\""), | 1488 | vec![ |
| 1413 | format!("\"{PROPOSAL_TITLE_1}\""), | 1489 | format!("\"{PROPOSAL_TITLE_3}\""), |
| 1414 | ])?; | 1490 | format!("\"{PROPOSAL_TITLE_2}\""), |
| 1491 | format!("\"{PROPOSAL_TITLE_1}\""), | ||
| 1492 | ], | ||
| 1493 | )?; | ||
| 1415 | c.succeeds_with(2, true, None)?; | 1494 | c.succeeds_with(2, true, None)?; |
| 1416 | 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")?; |
| 1417 | let mut c = p.expect_choice("", vec![ | 1496 | let mut c = p.expect_choice( |
| 1418 | format!("checkout and overwrite existing proposal branch"), | 1497 | "", |
| 1419 | format!("checkout existing outdated proposal branch"), | 1498 | vec![ |
| 1420 | format!("apply to current branch with `git am`"), | 1499 | format!("checkout and overwrite existing proposal branch"), |
| 1421 | format!("download to ./patches"), | 1500 | format!("checkout existing outdated proposal branch"), |
| 1422 | format!("back"), | 1501 | format!("apply to current branch with `git am`"), |
| 1423 | ])?; | 1502 | format!("download to ./patches"), |
| 1503 | format!("back"), | ||
| 1504 | ], | ||
| 1505 | )?; | ||
| 1424 | c.succeeds_with(0, true, Some(0))?; | 1506 | c.succeeds_with(0, true, Some(0))?; |
| 1425 | 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")?; |
| 1426 | p.expect_end()?; | 1508 | p.expect_end()?; |