| 153 | } |
| 154 | |
| 155 | void TestAstyle::varTypeAssistant() |
| 156 | { |
| 157 | // think this: |
| 158 | // asdf = 1; |
| 159 | // and you execute the assistant to get: |
| 160 | // int asdf = 1; |
| 161 | |
| 162 | // test1: already indented |
| 163 | QString formattedSource = m_formatter->formatSource( |
| 164 | QStringLiteral("int "), QStringLiteral("int main() {\n "), QStringLiteral("asdf = 1;\n}\n") |
| 165 | ); |
| 166 | qDebug() << "formatted source:" << formattedSource; |
| 167 | QCOMPARE(formattedSource, QString("int ")); |
| 168 | |
| 169 | // test2: not yet indented |
| 170 | formattedSource = m_formatter->formatSource( |
| 171 | QStringLiteral("int "), QStringLiteral("int main() {\n"), QStringLiteral("asdf = 1;\n}\n") |
| 172 | ); |
| 173 | qDebug() << "formatted source:" << formattedSource; |
| 174 | QCOMPARE(formattedSource, QString(" int ")); |
| 175 | |
| 176 | } |
| 177 | |
| 178 | void TestAstyle::testMultipleFormatters() |
| 179 | { |
nothing calls this directly
no test coverage detected