mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 05:27:45 +00:00
LibDiff: Fix wrong index used when prepending context lines
`i` is used as the index for 'old lines' in diff generation, not 'new lines'. Using the wrong index would mean that for certain diffs the prefixed context information would have wrong content, and could even result in a crash. Fix this, and add a test for an input which was previously crashing.
This commit is contained in:
parent
4adbf1d041
commit
b738929195
4 changed files with 117 additions and 1 deletions
7
Tests/LibDiff/CMakeLists.txt
Normal file
7
Tests/LibDiff/CMakeLists.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
set(TEST_SOURCES
|
||||
TestDiff.cpp
|
||||
)
|
||||
|
||||
foreach(source IN LISTS TEST_SOURCES)
|
||||
serenity_test("${source}" LibDiff LIBS LibDiff)
|
||||
endforeach()
|
Loading…
Add table
Add a link
Reference in a new issue