()
| 1287 | |
| 1288 | #[test] |
| 1289 | fn test_all_error_variants_have_display() { |
| 1290 | // Ensure all error variants can be displayed without panicking |
| 1291 | let errors: Vec<CliError> = vec![ |
| 1292 | CliError::repository_not_found("/path"), |
| 1293 | CliError::repository_exists("/path"), |
| 1294 | CliError::invalid_path("/path", None), |
| 1295 | CliError::InvalidRepository { |
| 1296 | reason: "corrupted".into(), |
| 1297 | }, |
| 1298 | CliError::view_not_found("main"), |
| 1299 | CliError::ViewAlreadyExists { name: "dev".into() }, |
| 1300 | CliError::CannotDeleteCurrentView { name: "dev".into() }, |
| 1301 | CliError::file_not_found("test.txt"), |
| 1302 | CliError::FileNotTracked { |
| 1303 | path: "test.txt".into(), |
| 1304 | }, |
| 1305 | CliError::FileAlreadyTracked { |
| 1306 | path: "test.txt".into(), |
| 1307 | }, |
| 1308 | CliError::PathOutsideRepository { |
| 1309 | path: "../outside".into(), |
| 1310 | }, |
| 1311 | CliError::NothingToRecord, |
| 1312 | CliError::change_not_found("ABC"), |
| 1313 | CliError::AmbiguousHash { hash: "AB".into() }, |
| 1314 | CliError::MissingDependency { |
| 1315 | change: "A".into(), |
| 1316 | dependency: "B".into(), |
| 1317 | }, |
| 1318 | CliError::Conflict { |
| 1319 | description: "conflict".into(), |
| 1320 | }, |
| 1321 | CliError::remote_error("failed", None), |
| 1322 | CliError::RemoteNotFound { |
| 1323 | name: "origin".into(), |
| 1324 | }, |
| 1325 | CliError::AuthenticationFailed { |
| 1326 | remote: "origin".into(), |
| 1327 | }, |
| 1328 | CliError::Cancelled, |
| 1329 | CliError::InvalidArgument { |
| 1330 | message: "bad".into(), |
| 1331 | }, |
| 1332 | ]; |
| 1333 | |
| 1334 | for err in errors { |
| 1335 | // Just ensure to_string() doesn't panic |
| 1336 | let _ = err.to_string(); |
| 1337 | // Also ensure suggestion() doesn't panic |
| 1338 | let _ = err.suggestion(); |
| 1339 | // And exit_code() doesn't panic |
| 1340 | let _ = err.exit_code(); |
| 1341 | } |
| 1342 | } |
| 1343 | } |
nothing calls this directly
no test coverage detected