| 1026 | |
| 1027 | #[test] |
| 1028 | fn test_push_branch_flag() { |
| 1029 | let push = Push::try_parse_from(["push", "--branch", "pr-42"]) |
| 1030 | .map_err(|e| e.to_string()) |
| 1031 | .unwrap(); |
| 1032 | assert_eq!(push.branch.as_deref(), Some("pr-42")); |
| 1033 | |
| 1034 | let push = Push::try_parse_from(["push", "-b", "pr-42"]) |
| 1035 | .map_err(|e| e.to_string()) |
| 1036 | .unwrap(); |
| 1037 | assert_eq!(push.branch.as_deref(), Some("pr-42")); |
| 1038 | |
| 1039 | let push = Push::try_parse_from(["push"]) |
| 1040 | .map_err(|e| e.to_string()) |
| 1041 | .unwrap(); |
| 1042 | assert!(push.branch.is_none()); |
| 1043 | } |
| 1044 | |
| 1045 | #[test] |
| 1046 | fn test_parse_trailer() { |