()
| 241 | |
| 242 | #[test] |
| 243 | fn test_view_commands_variants() { |
| 244 | // Ensure all variants exist and can be matched |
| 245 | fn check_variant(cmd: &ViewCommands) -> &'static str { |
| 246 | match cmd { |
| 247 | ViewCommands::Create(_) => "create", |
| 248 | ViewCommands::Split(_) => "split", |
| 249 | ViewCommands::Switch(_) => "switch", |
| 250 | ViewCommands::Delete(_) => "delete", |
| 251 | ViewCommands::List(_) => "list", |
| 252 | ViewCommands::Show(_) => "show", |
| 253 | ViewCommands::Promote(_) => "promote", |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | // Create instances of each variant |
| 258 | let new = New::default(); |
| 259 | let switch = Switch::default(); |
| 260 | let delete = Delete::default(); |
| 261 | let list = List::default(); |
| 262 | let show = Show::default(); |
| 263 | |
| 264 | let promote = Promote { name: None }; |
| 265 | |
| 266 | assert_eq!(check_variant(&ViewCommands::Create(new)), "create"); |
| 267 | assert_eq!(check_variant(&ViewCommands::Switch(switch)), "switch"); |
| 268 | assert_eq!(check_variant(&ViewCommands::Delete(delete)), "delete"); |
| 269 | assert_eq!(check_variant(&ViewCommands::List(list)), "list"); |
| 270 | assert_eq!(check_variant(&ViewCommands::Show(show)), "show"); |
| 271 | assert_eq!(check_variant(&ViewCommands::Promote(promote)), "promote"); |
| 272 | } |
| 273 | } |
nothing calls this directly
no outgoing calls
no test coverage detected