()
| 320 | |
| 321 | #[test] |
| 322 | fn generates_ast_patch_and_preview_diff() { |
| 323 | let patch = PatchEngine::generate_ast_patch( |
| 324 | "src/client.ts", |
| 325 | "retryRequest", |
| 326 | ASTTransformation::ReplaceFunctionBody, |
| 327 | ); |
| 328 | match &patch.representation { |
| 329 | PatchRepresentation::ASTTransform(edit) => { |
| 330 | let diff = PatchEngine::ast_to_diff(&patch.file_path, edit); |
| 331 | assert!(diff.contains("retryRequest")); |
| 332 | assert!(diff.contains("AST_EDIT")); |
| 333 | } |
| 334 | PatchRepresentation::UnifiedDiff(_) => panic!("expected ast transform"), |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | #[test] |
| 339 | fn replacement_patch_round_trips_and_validates() { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…