()
| 320 | #[test] |
| 321 | #[serial] |
| 322 | fn test_list_after_switch() { |
| 323 | use tempfile::tempdir; |
| 324 | |
| 325 | let _guard = DirGuard::new(); |
| 326 | let temp = tempdir().unwrap(); |
| 327 | let repo_path = temp.path(); |
| 328 | |
| 329 | // Initialize a repository and create a view, then drop to release lock |
| 330 | { |
| 331 | let mut repo = Repository::init(repo_path).unwrap(); |
| 332 | repo.create_view("feature").unwrap(); |
| 333 | repo.align_to_view("feature").unwrap(); |
| 334 | } |
| 335 | |
| 336 | // Change to the repo directory |
| 337 | std::env::set_current_dir(repo_path).unwrap(); |
| 338 | |
| 339 | // List views - should mark "feature" as current |
| 340 | let cmd = List::new(); |
| 341 | let result = cmd.run(); |
| 342 | assert!(result.is_ok()); |
| 343 | |
| 344 | // Verify we're still on feature |
| 345 | let repo = Repository::open(repo_path).unwrap(); |
| 346 | assert_eq!(repo.current_view(), "feature"); |
| 347 | } |
| 348 | } |
nothing calls this directly
no test coverage detected