clang-format: [Java] Improve cast detection.

Before:
  a[b >> 1] = (byte)(c() << 4);

After:
  a[b >> 1] = (byte) (c() << 4);

llvm-svn: 222827
This commit is contained in:
Daniel Jasper
2014-11-26 12:23:10 +00:00
parent fb61eae0e4
commit 4f56b0bb88
2 changed files with 11 additions and 3 deletions

View File

@@ -54,6 +54,10 @@ TEST_F(FormatTestJava, NoAlternativeOperatorNames) {
verifyFormat("someObject.and();");
}
TEST_F(FormatTestJava, UnderstandsCasts) {
verifyFormat("a[b >> 1] = (byte) (c() << 4);");
}
TEST_F(FormatTestJava, FormatsInstanceOfLikeOperators) {
FormatStyle Style = getStyleWithColumns(50);
verifyFormat("return aaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"