Skip to content

Commit

Permalink
[clang-format][NFC] Test formatting the input before messing it up
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D158947
  • Loading branch information
owenca committed Aug 29, 2023
1 parent 5f66083 commit 6982f1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clang/unittests/Format/FormatTestBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ class FormatTestBase : public ::testing::Test {

void _verifyFormat(const char *File, int Line, llvm::StringRef Code,
const std::optional<FormatStyle> &Style = {}) {
_verifyFormat(File, Line, Code, test::messUp(Code), Style);
_verifyFormat(File, Line, Code, Code, Style);
if (const auto MessedUpCode{messUp(Code)}; MessedUpCode != Code)
_verifyFormat(File, Line, Code, MessedUpCode, Style);
}

void _verifyIncompleteFormat(const char *File, int Line, llvm::StringRef Code,
Expand Down

0 comments on commit 6982f1f

Please sign in to comment.