forked from qt-creator/qt-creator
ClangFormat: Add more unit-tests for if conditions
Change-Id: I4ed68fc6260bfb4b058d5714d64dfec638ae1953 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -404,6 +404,39 @@ TEST_F(ClangFormat, IndentEmptyLineInsideParantheses)
|
||||
" && b)"));
|
||||
}
|
||||
|
||||
TEST_F(ClangFormat, IndentInsideIf)
|
||||
{
|
||||
insertLines({"if (a && b",
|
||||
")"});
|
||||
|
||||
indenter.indentBlock(doc.findBlockByNumber(1), QChar::Null, TextEditor::TabSettings());
|
||||
|
||||
ASSERT_THAT(documentLines(), ElementsAre("if (a && b",
|
||||
" )"));
|
||||
}
|
||||
|
||||
TEST_F(ClangFormat, IndentInsideIf2)
|
||||
{
|
||||
insertLines({"if (a && b &&",
|
||||
")"});
|
||||
|
||||
indenter.indentBlock(doc.findBlockByNumber(1), QChar::Null, TextEditor::TabSettings());
|
||||
|
||||
ASSERT_THAT(documentLines(), ElementsAre("if (a && b &&",
|
||||
" )"));
|
||||
}
|
||||
|
||||
TEST_F(ClangFormat, IndentInsideIf3)
|
||||
{
|
||||
insertLines({"if (a || b",
|
||||
")"});
|
||||
|
||||
indenter.indentBlock(doc.findBlockByNumber(1), QChar::Null, TextEditor::TabSettings());
|
||||
|
||||
ASSERT_THAT(documentLines(), ElementsAre("if (a || b",
|
||||
" )"));
|
||||
}
|
||||
|
||||
TEST_F(ClangFormat, EmptyLineInInitializerList)
|
||||
{
|
||||
insertLines({"Bar foo{a,",
|
||||
|
||||
Reference in New Issue
Block a user