@Test public void parse_diff_with_multiple_files() throws IOException { String example = "Index: sample1\n" + "===================================================================\n" + "--- a/sample1\n" + "+++ b/sample1\n" + "@@ -1 +0,0 @@\n" + "-deleted line\n" + "Index: sample2\n" + "===================================================================\n" + "--- a/sample2\n" + "+++ b/sample2\n" + "@@ -0,0 +1 @@\n" + "+added line\n" + "Index: sample3\n" + "===================================================================\n" + "--- a/sample3\n" + "+++ b/sample3\n" + "@@ -0,0 +1,2 @@\n" + "+added line 1\n" + "+added line 2\n" + "Index: sample3-not-included\n" + "===================================================================\n" + "--- a/sample3-not-included\n" + "+++ b/sample3-not-included\n" + "@@ -0,0 +1,2 @@\n" + "+added line 1\n" + "+added line 2\n" + "Index: sample4\n" + "===================================================================\n" + "--- a/sample4\n" + "+++ b/sample4\n" + "@@ -1 +1,3 @@\n" + " same line\n" + "+added line 1\n" + "+added line 2\n"; printDiff(example); assertThat(underTest.changedLines()) .isEqualTo( ImmutableMap.of( rootBaseDir.resolve("sample2"), ImmutableSet.of(1), rootBaseDir.resolve("sample3"), ImmutableSet.of(1, 2), rootBaseDir.resolve("sample4"), ImmutableSet.of(2, 3))); }
Map<Path, Set<Integer>> changedLines() { return tracker.changedLines(); }
ChangedLinesComputer { Map<Path, Set<Integer>> changedLines() { return tracker.changedLines(); } }
ChangedLinesComputer { Map<Path, Set<Integer>> changedLines() { return tracker.changedLines(); } ChangedLinesComputer(Path rootBaseDir, Set<Path> included); }
ChangedLinesComputer { Map<Path, Set<Integer>> changedLines() { return tracker.changedLines(); } ChangedLinesComputer(Path rootBaseDir, Set<Path> included);  }
ChangedLinesComputer { Map<Path, Set<Integer>> changedLines() { return tracker.changedLines(); } ChangedLinesComputer(Path rootBaseDir, Set<Path> included);   }