summaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTestJava.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTestJava.cpp')
-rw-r--r--unittests/Format/FormatTestJava.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/unittests/Format/FormatTestJava.cpp b/unittests/Format/FormatTestJava.cpp
index 8fadfc09b3ed..dfc3debc46e2 100644
--- a/unittests/Format/FormatTestJava.cpp
+++ b/unittests/Format/FormatTestJava.cpp
@@ -25,10 +25,10 @@ protected:
DEBUG(llvm::errs() << Code << "\n\n");
std::vector<tooling::Range> Ranges(1, tooling::Range(Offset, Length));
tooling::Replacements Replaces = reformat(Style, Code, Ranges);
- std::string Result = applyAllReplacements(Code, Replaces);
- EXPECT_NE("", Result);
- DEBUG(llvm::errs() << "\n" << Result << "\n\n");
- return Result;
+ auto Result = applyAllReplacements(Code, Replaces);
+ EXPECT_TRUE(static_cast<bool>(Result));
+ DEBUG(llvm::errs() << "\n" << *Result << "\n\n");
+ return *Result;
}
static std::string
@@ -312,6 +312,9 @@ TEST_F(FormatTestJava, Annotations) {
" String bbbbbbbbbbbbbbb) {}\n"
"}",
getStyleWithColumns(60));
+ verifyFormat("@Annotation(\"Some\"\n"
+ " + \" text\")\n"
+ "List<Integer> list;");
}
TEST_F(FormatTestJava, Generics) {