diff options
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index b43f735d4cb..64bb28e0be2 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -9333,6 +9333,7 @@ TEST_F(FormatTest, ParsesConfigurationBools) { CHECK_PARSE_BOOL(Cpp11BracedListStyle); CHECK_PARSE_BOOL(ReflowComments); CHECK_PARSE_BOOL(SortIncludes); + CHECK_PARSE_BOOL(SortUsingDeclarations); CHECK_PARSE_BOOL(SpacesInParentheses); CHECK_PARSE_BOOL(SpacesInSquareBrackets); CHECK_PARSE_BOOL(SpacesInAngles); @@ -10874,6 +10875,13 @@ TEST_F(ReplacementTest, SortIncludesAfterReplacement) { EXPECT_EQ(Expected, *Result); } +TEST_F(FormatTest, FormatSortsUsingDeclarations) { + EXPECT_EQ("using std::cin;\n" + "using std::cout;", + format("using std::cout;\n" + "using std::cin;", getGoogleStyle())); +} + TEST_F(FormatTest, UTF8CharacterLiteralCpp03) { format::FormatStyle Style = format::getLLVMStyle(); Style.Standard = FormatStyle::LS_Cpp03; |