()
| 1199 | #[test] |
| 1200 | #[file_serial] |
| 1201 | fn test_list_after_switch() { |
| 1202 | use tempfile::tempdir; |
| 1203 | |
| 1204 | let _guard = DirGuard::new(); |
| 1205 | let temp = tempdir().unwrap(); |
| 1206 | let repo_path = temp.path(); |
| 1207 | |
| 1208 | // Initialize a repository and create a view, then drop to release lock |
| 1209 | { |
| 1210 | let mut repo = Repository::init(repo_path).unwrap(); |
| 1211 | repo.create_view("feature").unwrap(); |
| 1212 | let working_copy = repo.require_working_copy_id().unwrap(); |
| 1213 | repo.align_to_view(working_copy, "feature").unwrap(); |
| 1214 | } |
| 1215 | |
| 1216 | // Change to the repo directory |
| 1217 | std::env::set_current_dir(repo_path).unwrap(); |
| 1218 | |
| 1219 | // List views - should mark "feature" as current |
| 1220 | let cmd = List::new(); |
| 1221 | let result = cmd.run(); |
| 1222 | assert!(result.is_ok()); |
| 1223 | |
| 1224 | // Verify we're still on feature |
| 1225 | let repo = Repository::open(repo_path).unwrap(); |
| 1226 | assert_eq!(repo.current_view(), "feature"); |
| 1227 | } |
| 1228 | } |
nothing calls this directly
no test coverage detected