[PATCH] D37904: [clang-format] Fix FixNamespaceComments when BraceWrapping AfterNamespace is true.

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 07:04:07 PDT 2017


krasimir added a comment.

This is how you could add a test in `NamespaceEndCommentsFixerTest.cpp`:

  TEST_F(NamespaceEndCommentsFixerTest, FixesNamespaceCommentsInAllmanStyle) {
    FormatStyle AllmanStyle = getLLVMStyle();
    AllmanStyle.BreakBeforeBraces = FormatStyle::BS_Allman;
    EXPECT_EQ("namespace a\n"
              "{\n"
              "void f();\n"
              "void g();\n"
              "}// namespace a\n",
              fixNamespaceEndComments("namespace a\n"
                                      "{\n"
                                      "void f();\n"
                                      "void g();\n"
                                      "}\n",
                                      AllmanStyle));
  }


https://reviews.llvm.org/D37904





More information about the cfe-commits mailing list