()
| 306 | #[test] |
| 307 | #[serial] |
| 308 | fn test_list_after_switch() { |
| 309 | use tempfile::tempdir; |
| 310 | |
| 311 | let _guard = DirGuard::new(); |
| 312 | let temp = tempdir().unwrap(); |
| 313 | let repo_path = temp.path(); |
| 314 | |
| 315 | // Initialize a repository and create a view, then drop to release lock |
| 316 | { |
| 317 | let mut repo = Repository::init(repo_path).unwrap(); |
| 318 | repo.create_view("feature").unwrap(); |
| 319 | repo.align_to_view("feature").unwrap(); |
| 320 | } |
| 321 | |
| 322 | // Change to the repo directory |
| 323 | std::env::set_current_dir(repo_path).unwrap(); |
| 324 | |
| 325 | // List views - should mark "feature" as current |
| 326 | let cmd = List::new(); |
| 327 | let result = cmd.run(); |
| 328 | assert!(result.is_ok()); |
| 329 | |
| 330 | // Verify we're still on feature |
| 331 | let repo = Repository::open(repo_path).unwrap(); |
| 332 | assert_eq!(repo.current_view(), "feature"); |
| 333 | } |
| 334 | } |
nothing calls this directly
no test coverage detected