[PATCH] D68682: format::cleanupAroundReplacements removes whole line when Removals leave previously non-blank line blank

Conrad Poelman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 22 21:00:13 PST 2019


poelmanc marked 4 inline comments as done.
poelmanc added a comment.

In D68682#1754798 <https://reviews.llvm.org/D68682#1754798>, @kadircet wrote:

> `ToolingTests/ApplyAtomicChangesTest.FormatsCorrectLineWhenHeaderIsRemoved` also seems to be failing, you can run it with `ninja ToolingTests && ./tools/clang/unittests/Tooling/ToolingTests --gtest_filter="ApplyAtomicChangesTest.FormatsCorrectLineWhenHeaderIsRemoved"`


Thank you, this test revealed a real edge case for which the algorithm was failing, which I've now fixed and created a new test case to verify: If a set of Replacements removes all non-whitespace on a line **including** the trailing newline **and** the line is followed by a single newline character, it should not chomp the following newline as well.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68682/new/

https://reviews.llvm.org/D68682





More information about the cfe-commits mailing list