()
| 1106 | #[test] |
| 1107 | #[serial] |
| 1108 | fn test_list_after_switch() { |
| 1109 | use tempfile::tempdir; |
| 1110 | |
| 1111 | let _guard = DirGuard::new(); |
| 1112 | let temp = tempdir().unwrap(); |
| 1113 | let repo_path = temp.path(); |
| 1114 | |
| 1115 | // Initialize a repository and create a view, then drop to release lock |
| 1116 | { |
| 1117 | let mut repo = Repository::init(repo_path).unwrap(); |
| 1118 | repo.create_view("feature").unwrap(); |
| 1119 | repo.align_to_view("feature").unwrap(); |
| 1120 | } |
| 1121 | |
| 1122 | // Change to the repo directory |
| 1123 | std::env::set_current_dir(repo_path).unwrap(); |
| 1124 | |
| 1125 | // List views - should mark "feature" as current |
| 1126 | let cmd = List::new(); |
| 1127 | let result = cmd.run(); |
| 1128 | assert!(result.is_ok()); |
| 1129 | |
| 1130 | // Verify we're still on feature |
| 1131 | let repo = Repository::open(repo_path).unwrap(); |
| 1132 | assert_eq!(repo.current_view(), "feature"); |
| 1133 | } |
| 1134 | } |
nothing calls this directly
no test coverage detected