summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2018-01-17 16:17:26 +0000
committerKrasimir Georgiev <krasimir@google.com>2018-01-17 16:17:26 +0000
commit2537e2209454a67f9630fcacae6b05e2a7caffb1 (patch)
treecf133faa1ae78e23c05b6462ba78875baa0423bc /clang/unittests/Format/FormatTest.cpp
parent2c6fe505b1868033fa1e225ec5a777dbb9e01700 (diff)
downloadbcm5719-llvm-2537e2209454a67f9630fcacae6b05e2a7caffb1.tar.gz
bcm5719-llvm-2537e2209454a67f9630fcacae6b05e2a7caffb1.zip
[clang-format] adds enclosing function detection to raw string formatting
Summary: This patch adds enclosing function detection to raw string formatting. Reviewers: bkramer Reviewed By: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42167 llvm-svn: 322678
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index b453a62a69c..61973c621c7 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -10408,8 +10408,18 @@ TEST_F(FormatTest, ParsesConfiguration) {
Style.RawStringFormats.clear();
std::vector<FormatStyle::RawStringFormat> ExpectedRawStringFormats = {
- {FormatStyle::LK_TextProto, {"pb", "proto"}, "llvm"},
- {FormatStyle::LK_Cpp, {"cc", "cpp"}, "google"},
+ {
+ FormatStyle::LK_TextProto,
+ {"pb", "proto"},
+ {"PARSE_TEXT_PROTO"},
+ "llvm",
+ },
+ {
+ FormatStyle::LK_Cpp,
+ {"cc", "cpp"},
+ {"C_CODEBLOCK", "CPPEVAL"},
+ "",
+ },
};
CHECK_PARSE("RawStringFormats:\n"
@@ -10417,12 +10427,16 @@ TEST_F(FormatTest, ParsesConfiguration) {
" Delimiters:\n"
" - 'pb'\n"
" - 'proto'\n"
+ " EnclosingFunctions:\n"
+ " - 'PARSE_TEXT_PROTO'\n"
" BasedOnStyle: llvm\n"
" - Language: Cpp\n"
" Delimiters:\n"
" - 'cc'\n"
" - 'cpp'\n"
- " BasedOnStyle: google\n",
+ " EnclosingFunctions:\n"
+ " - 'C_CODEBLOCK'\n"
+ " - 'CPPEVAL'\n",
RawStringFormats, ExpectedRawStringFormats);
}
OpenPOWER on IntegriCloud