diff options
author | Krasimir Georgiev <krasimir@google.com> | 2017-03-01 16:38:08 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2017-03-01 16:38:08 +0000 |
commit | 85c3704c0da1bbc88c45ecfb0a5c8bef1df50d25 (patch) | |
tree | 6e816a4aeb17a95c7b84e51d51762dcc3b39d838 /clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp | |
parent | 570c23035770a7ce9438efea7c15f06b782bdf6e (diff) | |
download | bcm5719-llvm-85c3704c0da1bbc88c45ecfb0a5c8bef1df50d25.tar.gz bcm5719-llvm-85c3704c0da1bbc88c45ecfb0a5c8bef1df50d25.zip |
[clang-format] Don't add namespace end comments for unbalanced right braces after namespace end
llvm-svn: 296638
Diffstat (limited to 'clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp')
-rw-r--r-- | clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp b/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp index 09f21929c37..c24894e7d4e 100644 --- a/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp +++ b/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp @@ -345,6 +345,18 @@ TEST_F(NamespaceEndCommentsFixerTest, "}\n" "}\n")); } + +TEST_F(NamespaceEndCommentsFixerTest, + DoesNotAddEndCommentForUnbalancedRBracesAfterNamespaceEnd) { + EXPECT_EQ("namespace {\n" + " int i;\n" + "} // namespace\n" + "}", + fixNamespaceEndComments("namespace {\n" + " int i;\n" + "} // namespace\n" + "}")); +} } // end namespace } // end namespace format } // end namespace clang |