Skip to content

Commit

Permalink
Add a test case to FormatTest
Browse files Browse the repository at this point in the history
  • Loading branch information
owenca committed Apr 3, 2024
1 parent a0c5098 commit a0f27d0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions clang/unittests/Format/FormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27235,6 +27235,18 @@ TEST_F(FormatTest, PPBranchesInBracedInit) {
"};");
}

TEST_F(FormatTest, PPDirectivesAndCommentsInBracedInit) {
verifyFormat("{\n"
" char *a[] = {\n"
" /* abc */ \"abc\",\n"
"#if FOO\n"
" /* xyz */ \"xyz\",\n"
"#endif\n"
" /* last */ \"last\"};\n"
"}",
getLLVMStyleWithColumns(30));
}

TEST_F(FormatTest, StreamOutputOperator) {
verifyFormat("std::cout << \"foo\" << \"bar\" << baz;");
verifyFormat("std::cout << \"foo\\n\"\n"
Expand Down

0 comments on commit a0f27d0

Please sign in to comment.