Fix typo in UnifiedDiff#spplyPatchTo(Predicate<String>, List<String>) (#127)

* Fix typo in UnifiedDiff.java

Changes UnifiedDiff#spplyPatchTo to UnifiedDiff#applyPatchTo

* Fix typo in test

Fixes the method invocation in the UnifiedDiff roundtrip test to account for the typo fix in UnifiedDiff
This commit is contained in:
Ilari Suhonen
2021-07-07 08:15:55 +03:00
committed by GitHub
parent 3d5343c283
commit 89ce301123
2 changed files with 2 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ public final class UnifiedDiff {
return tail;
}
public List<String> spplyPatchTo(Predicate<String> findFile, List<String> originalLines) throws PatchFailedException {
public List<String> applyPatchTo(Predicate<String> findFile, List<String> originalLines) throws PatchFailedException {
UnifiedDiffFile file = files.stream()
.filter(diff -> findFile.test(diff.getFromFile()))
.findFirst().orElse(null);

View File

@@ -150,7 +150,7 @@ public class UnifiedDiffRoundTripTest {
// Patch<String> fromUnifiedPatch = unifiedDiff.getFiles().get(0).getPatch();
// patchedLines = fromUnifiedPatch.applyTo(origLines);
// }
patchedLines = unifiedDiff.spplyPatchTo(file -> originalFile.equals(file), origLines);
patchedLines = unifiedDiff.applyPatchTo(file -> originalFile.equals(file), origLines);
assertEquals(revLines.size(), patchedLines.size());
for (int i = 0; i < revLines.size(); i++) {
String l1 = revLines.get(i);