forked from qt-creator/qt-creator
[ClangFormat] Add test checkking indentation after Q_OBJECT
Added test checking behavior when after Q_OBJECT all class structure have correct indenting and redundent tabs doesn't appear before key words such as public:, private: , etc. Made automatic addition Qt defines to StatementMacro to .clang-format files. Fixes: QTCREATORBUG-26776 Change-Id: I3490421a9caf2831b593939597940358f7ce8f01 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -646,4 +646,12 @@ void ClangFormatTest::testCommentBlock()
|
||||
"****************************************************************************/"}));
|
||||
}
|
||||
|
||||
void ClangFormatTest::testClassIndentStructure()
|
||||
{
|
||||
insertLines({"class test {", " Q_OBJECT", " public:", "};"});
|
||||
m_indenter->indent(*m_cursor, QChar::Null, TextEditor::TabSettings());
|
||||
QCOMPARE(documentLines(),
|
||||
(std::vector<QString>{"class test {", " Q_OBJECT", "public:", "};"}));
|
||||
}
|
||||
|
||||
} // namespace ClangFormat::Internal
|
||||
|
||||
Reference in New Issue
Block a user