aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestJava.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2023-06-16 00:00:43 -0700
committerOwen Pan <owenpiano@gmail.com>2023-06-16 16:03:19 -0700
commit20b4df1ed611517d2c964dbade3e61aff4be2e87 (patch)
treeb540e8fd7c1d024d9cf632ac81831bb5ce670529 /clang/unittests/Format/FormatTestJava.cpp
parent12c12c5fe0f0ec55086bbd1609c847db6c269cdf (diff)
downloadllvm-20b4df1ed611517d2c964dbade3e61aff4be2e87.zip
llvm-20b4df1ed611517d2c964dbade3e61aff4be2e87.tar.gz
llvm-20b4df1ed611517d2c964dbade3e61aff4be2e87.tar.bz2
[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
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJava.cpp3
1 files changed, 1 insertions, 2 deletions
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) {