()
| 1038 | |
| 1039 | #[test] |
| 1040 | fn test_all_error_variants_have_display() { |
| 1041 | // Ensure all error variants can be displayed without panicking |
| 1042 | let errors: Vec<CliError> = vec![ |
| 1043 | CliError::repository_not_found("/path"), |
| 1044 | CliError::repository_exists("/path"), |
| 1045 | CliError::invalid_path("/path", None), |
| 1046 | CliError::InvalidRepository { |
| 1047 | reason: "corrupted".into(), |
| 1048 | }, |
| 1049 | CliError::view_not_found("main"), |
| 1050 | CliError::ViewAlreadyExists { name: "dev".into() }, |
| 1051 | CliError::CannotDeleteCurrentView { name: "dev".into() }, |
| 1052 | CliError::file_not_found("test.txt"), |
| 1053 | CliError::FileNotTracked { |
| 1054 | path: "test.txt".into(), |
| 1055 | }, |
| 1056 | CliError::FileAlreadyTracked { |
| 1057 | path: "test.txt".into(), |
| 1058 | }, |
| 1059 | CliError::PathOutsideRepository { |
| 1060 | path: "../outside".into(), |
| 1061 | }, |
| 1062 | CliError::NothingToRecord, |
| 1063 | CliError::change_not_found("ABC"), |
| 1064 | CliError::AmbiguousHash { hash: "AB".into() }, |
| 1065 | CliError::MissingDependency { |
| 1066 | change: "A".into(), |
| 1067 | dependency: "B".into(), |
| 1068 | }, |
| 1069 | CliError::Conflict { |
| 1070 | description: "conflict".into(), |
| 1071 | }, |
| 1072 | CliError::remote_error("failed", None), |
| 1073 | CliError::RemoteNotFound { |
| 1074 | name: "origin".into(), |
| 1075 | }, |
| 1076 | CliError::AuthenticationFailed { |
| 1077 | remote: "origin".into(), |
| 1078 | }, |
| 1079 | CliError::Cancelled, |
| 1080 | CliError::InvalidArgument { |
| 1081 | message: "bad".into(), |
| 1082 | }, |
| 1083 | ]; |
| 1084 | |
| 1085 | for err in errors { |
| 1086 | // Just ensure to_string() doesn't panic |
| 1087 | let _ = err.to_string(); |
| 1088 | // Also ensure suggestion() doesn't panic |
| 1089 | let _ = err.suggestion(); |
| 1090 | // And exit_code() doesn't panic |
| 1091 | let _ = err.exit_code(); |
| 1092 | } |
| 1093 | } |
| 1094 | } |
nothing calls this directly
no test coverage detected