From: Backl1ght Date: Fri, 16 Dec 2022 12:53:58 +0000 (+0800) Subject: [clang-format] add config parse test for short lambda X-Git-Tag: upstream/17.0.6~23553 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95c1a17433b972e8345b672f69005204dab0916d;p=platform%2Fupstream%2Fllvm.git [clang-format] add config parse test for short lambda Reviewed By: HazardyKnusperkeks, MyDeveloperDay Differential Revision: https://reviews.llvm.org/D140105 --- diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp index a65fffc..777b2c2 100644 --- a/clang/unittests/Format/ConfigParseTest.cpp +++ b/clang/unittests/Format/ConfigParseTest.cpp @@ -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);