From 20b4df1ed611517d2c964dbade3e61aff4be2e87 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 16 Jun 2023 00:00:43 -0700 Subject: [clang-format][NFC] Clean up unit tests This patch adds a verifyNoChange macro to verify code that won't change after being formatted. (The code will not be messed up before being formatted.) It then replaces EXPECT_EQ with verifyFormat wherever applicable so that the code will be messed up before being formatted. When the replacement fails the unit test, verifyFormat is replaced with verifyNoChange. Differential Revision: https://reviews.llvm.org/D153109 --- clang/unittests/Format/FormatTestJava.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/unittests/Format/FormatTestJava.cpp') diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index 7b25a0b..51afe79 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -567,8 +567,7 @@ TEST_F(FormatTestJava, FormatsLambdas) { TEST_F(FormatTestJava, BreaksStringLiterals) { // FIXME: String literal breaking is currently disabled for Java and JS, as it // requires strings to be merged using "+" which we don't support. - EXPECT_EQ("\"some text other\";", - format("\"some text other\";", getStyleWithColumns(14))); + verifyFormat("\"some text other\";", getStyleWithColumns(14)); } TEST_F(FormatTestJava, AlignsBlockComments) { -- cgit v1.1