Skip to content

Commit

Permalink
Add a (currently) failing test for EOL diff parsing
Browse files Browse the repository at this point in the history
See issue #50
  • Loading branch information
andrewshadura committed Jul 5, 2023
1 parent 8020a3f commit 70618da
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions git_crecord/crpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,23 @@ def parsepatch(fp: IO[bytes]) -> PatchRoot:
\ No newline at end of file
+quuux
And the other way around:
>>> rawpatch = b'''diff --git a/test b/test
... --- a/test
... +++ b/test
... @@ -1 +1 @@
... -test
... +test
... \\ No newline at end of file
... '''
>>> fp = io.BytesIO(rawpatch)
>>> headers = parsepatch(fp)
>>> print(headers[0].hunks[0])
@@ -1,1 +1,1 @@
-test
+test
\ No newline at end of file
It is possible to handle non-UTF-8 patches:
>>> rawpatch = b'''diff --git a/test b/test
... --- /dev/null
Expand Down

0 comments on commit 70618da

Please sign in to comment.