Billy Keyes
1b341e0693
Add error tests for TextFragment#ApplyStrict
...
These cover the errors that can happen with a single fragment and no
additional manipulation by the caller of ApplyStrict.
2020-01-12 22:09:08 -08:00
Billy Keyes
6a055aa600
Add exact line test for TextFragment#ApplyStrict
...
This ensures the line number is used and application isn't based only on
matching context lines.
2020-01-12 22:08:15 -08:00
Billy Keyes
7bd4e0bb0e
Fix EOF handling in TextFragment#ApplyStrict
...
io.EOF was not properly accounted for when dealing with patches that are
missing trailing newline characters.
2020-01-09 22:05:24 -08:00
Billy Keyes
02f7ff4f79
Add positive tests for TextFragment#ApplyStrict
...
These cover all of the cases (I think) where application should succeed.
2020-01-08 23:04:44 -08:00
Billy Keyes
16539ad031
Add tests for parsing full binary fragments
2019-04-14 19:18:08 -07:00
Billy Keyes
69e4444419
Return preamble content when parsing files
...
This allows callers to provide patches with commit or email headers and
then retrieve that leading content for additional parsing without
having to identify where the first file in the patch starts.
2019-04-07 19:57:11 -07:00
Billy Keyes
07e5314a7c
Remove second commit header from test file
...
While it's cool that this works, in a multi-file patch each file
immediately follow the final fragment of the previous file.
2019-04-07 17:49:15 -07:00
Billy Keyes
09c686917c
Add test for multiple files in one patch
...
For simplicity, use the same fragments in both of these files and in the
single file test.
2019-04-06 19:13:42 -07:00
Billy Keyes
47d923e573
Add simple full file parsing test
...
For now, this uses JSON to print objects on error, which is hard to
debug. It should probably use something like google/go-cmp instead,
because these objects are now too large for direct comparison.
2019-04-03 23:01:44 -07:00