Skip to content

Commit

Permalink
[clang-format] add config parse test for short lambda
Browse files Browse the repository at this point in the history
Reviewed By: HazardyKnusperkeks, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D140105
  • Loading branch information
Backl1ght committed Dec 16, 2022
1 parent e6676a1 commit 95c1a17
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions clang/unittests/Format/ConfigParseTest.cpp
Expand Up @@ -533,6 +533,21 @@ TEST(ConfigParseTest, ParsesConfiguration) {
CHECK_PARSE("AllowShortFunctionsOnASingleLine: true",
AllowShortFunctionsOnASingleLine, FormatStyle::SFS_All);

Style.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All;
CHECK_PARSE("AllowShortLambdasOnASingleLine: None",
AllowShortLambdasOnASingleLine, FormatStyle::SLS_None);
CHECK_PARSE("AllowShortLambdasOnASingleLine: Empty",
AllowShortLambdasOnASingleLine, FormatStyle::SLS_Empty);
CHECK_PARSE("AllowShortLambdasOnASingleLine: Inline",
AllowShortLambdasOnASingleLine, FormatStyle::SLS_Inline);
CHECK_PARSE("AllowShortLambdasOnASingleLine: All",
AllowShortLambdasOnASingleLine, FormatStyle::SLS_All);
// For backward compatibility:
CHECK_PARSE("AllowShortLambdasOnASingleLine: false",
AllowShortLambdasOnASingleLine, FormatStyle::SLS_None);
CHECK_PARSE("AllowShortLambdasOnASingleLine: true",
AllowShortLambdasOnASingleLine, FormatStyle::SLS_All);

Style.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_Both;
CHECK_PARSE("SpaceAroundPointerQualifiers: Default",
SpaceAroundPointerQualifiers, FormatStyle::SAPQ_Default);
Expand Down

0 comments on commit 95c1a17

Please sign in to comment.