mirror of
https://github.com/java-diff-utils/java-diff-utils.git
synced 2026-03-13 10:11:17 +08:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user