diff options
author | Daniel Jasper <djasper@google.com> | 2013-10-30 13:54:53 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-10-30 13:54:53 +0000 |
commit | 8437957c9da906c24d4e385869c05d8e601c664d (patch) | |
tree | 1c2451d705febb5af5eb04b90fba97b3d5f71ceb /unittests/Format | |
parent | c70cc5d90403f99ccce5cab3a6c022ad9cdcb66c (diff) | |
download | clang-8437957c9da906c24d4e385869c05d8e601c664d.tar.gz |
clang-format: Fix whitespaces in include directives.
Before (clang-format wouldn't change):
#include "a.h"
#include<a>
After:
#include "a.h"
#include <a>
This fixes llvm.org/PR16151.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 2f6e06ff02..639b8c89d9 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -668,8 +668,7 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) { "#include \"a/b/c\" // comment"); verifyFormat("#include <a> // comment\n" "#include <a/b/c> // comment"); - EXPECT_EQ("#include \\\n" - " \"a\" // comment\n" + EXPECT_EQ("#include \"a\" // comment\n" "#include \"a/b/c\" // comment", format("#include \\\n" " \"a\" // comment\n" @@ -4295,6 +4294,8 @@ TEST_F(FormatTest, HandlesIncludeDirectives) { "#include \"some long include\" // with a comment\n" "#include \"some very long include paaaaaaaaaaaaaaaaaaaaaaath\"", getLLVMStyleWithColumns(35)); + EXPECT_EQ("#include \"a.h\"", format("#include \"a.h\"")); + EXPECT_EQ("#include <a>", format("#include<a>")); verifyFormat("#import <string>"); verifyFormat("#import <a/b/c.h>"); |