diff options
Diffstat (limited to 'clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp')
-rw-r--r-- | clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp b/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp index 5b98590a6555..50b861fea1da 100644 --- a/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp +++ b/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp @@ -189,6 +189,49 @@ TEST_F(NamespaceEndCommentsFixerTest, AddsEndComment) { "int i;\n" "int j;\n" "}")); + EXPECT_EQ("#define M(x) x##x\n" + "namespace A M(x) {\n" + "int i;\n" + "int j;\n" + "}// namespace A M(x)", + fixNamespaceEndComments("#define M(x) x##x\n" + "namespace A M(x) {\n" + "int i;\n" + "int j;\n" + "}")); + EXPECT_EQ( + "#define B __attribute__((availability(macos, introduced=10.15)))\n" + "namespace A B {\n" + "int i;\n" + "int j;\n" + "}// namespace A B", + fixNamespaceEndComments( + "#define B __attribute__((availability(macos, introduced=10.15)))\n" + "namespace A B {\n" + "int i;\n" + "int j;\n" + "}")); + EXPECT_EQ("#define M(x) x##x\n" + "namespace A::B M(x) {\n" + "int i;\n" + "int j;\n" + "}// namespace A::B", + fixNamespaceEndComments("#define M(x) x##x\n" + "namespace A::B M(x) {\n" + "int i;\n" + "int j;\n" + "}")); + EXPECT_EQ( + "namespace A __attribute__((availability(macos, introduced=10.15))) {\n" + "int i;\n" + "int j;\n" + "}// namespace A", + fixNamespaceEndComments( + "namespace A __attribute__((availability(macos, introduced=10.15))) " + "{\n" + "int i;\n" + "int j;\n" + "}")); EXPECT_EQ("inline namespace A {\n" "int i;\n" "int j;\n" |