()
| 465 | #[test] |
| 466 | #[serial] |
| 467 | fn test_list_after_switch() { |
| 468 | use tempfile::tempdir; |
| 469 | |
| 470 | let _guard = DirGuard::new(); |
| 471 | let temp = tempdir().unwrap(); |
| 472 | let repo_path = temp.path(); |
| 473 | |
| 474 | // Initialize a repository and create a view, then drop to release lock |
| 475 | { |
| 476 | let mut repo = Repository::init(repo_path).unwrap(); |
| 477 | repo.create_view("feature").unwrap(); |
| 478 | repo.align_to_view("feature").unwrap(); |
| 479 | } |
| 480 | |
| 481 | // Change to the repo directory |
| 482 | std::env::set_current_dir(repo_path).unwrap(); |
| 483 | |
| 484 | // List views - should mark "feature" as current |
| 485 | let cmd = List::new(); |
| 486 | let result = cmd.run(); |
| 487 | assert!(result.is_ok()); |
| 488 | |
| 489 | // Verify we're still on feature |
| 490 | let repo = Repository::open(repo_path).unwrap(); |
| 491 | assert_eq!(repo.current_view(), "feature"); |
| 492 | } |
| 493 | } |
nothing calls this directly
no test coverage detected