fix: handle empty inputs in patch generation

This commit is contained in:
mrT23
2025-01-04 16:30:33 +02:00
parent e431979b8b
commit d4d58babd5

View File

@ -182,4 +182,10 @@ class TestLoadLargeDiff:
+ some new content
+ another line
"""
assert patch == patch_expected
assert patch == patch_expected
def test_empty_inputs(self):
assert load_large_diff("test.py", "", "") == ""
assert load_large_diff("test.py", None, None) == ""
assert (load_large_diff("test.py", "content\n", "") ==
'--- \n+++ \n@@ -1 +1 @@\n-\n+content\n')