diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-03-27 17:08:02 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-03-27 17:08:02 +0000 |
commit | 94b748ff16172f0da2b842fe0d5bae438f07034f (patch) | |
tree | 0ff7c14db4e75644b4acf23a8f0fe475a6d0f37d /unittests | |
parent | c544ba09695e300f31355af342258bd57619e737 (diff) |
Insert extra new line before access specifiers.
Summary: Insert extra new line before access specifiers.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D581
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index daeb1dbaf0..7fbb9f3ac4 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -937,6 +937,28 @@ TEST_F(FormatTest, UnderstandsAccessSpecifiers) { "};"); } +TEST_F(FormatTest, SeparatesLogicalBlocks) { + EXPECT_EQ("class A {\n" + "public:\n" + " void f();\n" + "\n" + "private:\n" + " void g() {}\n" + " // test\n" + "protected:\n" + " int h;\n" + "};", + format("class A {\n" + "public:\n" + "void f();\n" + "private:\n" + "void g() {}\n" + "// test\n" + "protected:\n" + "int h;\n" + "};")); +} + TEST_F(FormatTest, FormatsDerivedClass) { verifyFormat("class A : public B {\n};"); verifyFormat("class A : public ::B {\n};"); |