()
| 468 | |
| 469 | #[test] |
| 470 | fn test_file_diff_compute_stats() { |
| 471 | let mut diff = FileDiff::modified("test.rs"); |
| 472 | let mut graph_op = DiffHunk::new(1, 2, 1, 3); |
| 473 | graph_op.add_line(HunkLine::context("line1", 1, 1)); |
| 474 | graph_op.add_line(HunkLine::removed("old line", 2)); |
| 475 | graph_op.add_line(HunkLine::added("new line 1", 2)); |
| 476 | graph_op.add_line(HunkLine::added("new line 2", 3)); |
| 477 | diff.add_hunk(graph_op); |
| 478 | |
| 479 | diff.compute_stats(); |
| 480 | |
| 481 | assert_eq!(diff.stats.insertions, 2); |
| 482 | assert_eq!(diff.stats.deletions, 1); |
| 483 | } |
| 484 | |
| 485 | #[test] |
| 486 | fn test_file_diff_has_changes() { |
nothing calls this directly
no test coverage detected