diff options
Diffstat (limited to 'src/plugins/cppeditor/cppquickfix_test.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppquickfix_test.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index fc026a6c25..c362ff1ee0 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -1414,6 +1414,39 @@ void CppEditorPlugin::test_quickfix_data() << CppQuickFixFactoryPtr(new InsertQtPropertyMembers) << _("class C { @Q_PROPERTY(typeid foo READ foo) };\n") << _(); + + QTest::newRow("convert to camel case: normal") + << CppQuickFixFactoryPtr(new ConvertToCamelCase(true)) + << _("void @lower_case_function();\n") + << _("void lowerCaseFunction();\n"); + QTest::newRow("convert to camel case: already camel case") + << CppQuickFixFactoryPtr(new ConvertToCamelCase(true)) + << _("void @camelCaseFunction();\n") + << _(); + QTest::newRow("convert to camel case: no underscores (lower case)") + << CppQuickFixFactoryPtr(new ConvertToCamelCase(true)) + << _("void @lowercasefunction();\n") + << _(); + QTest::newRow("convert to camel case: no underscores (upper case)") + << CppQuickFixFactoryPtr(new ConvertToCamelCase(true)) + << _("void @UPPERCASEFUNCTION();\n") + << _(); + QTest::newRow("convert to camel case: non-applicable underscore") + << CppQuickFixFactoryPtr(new ConvertToCamelCase(true)) + << _("void @m_a_member;\n") + << _("void m_aMember;\n"); + QTest::newRow("convert to camel case: upper case") + << CppQuickFixFactoryPtr(new ConvertToCamelCase(true)) + << _("void @UPPER_CASE_FUNCTION();\n") + << _("void upperCaseFunction();\n"); + QTest::newRow("convert to camel case: partially camel case already") + << CppQuickFixFactoryPtr(new ConvertToCamelCase(true)) + << _("void mixed@_andCamelCase();\n") + << _("void mixedAndCamelCase();\n"); + QTest::newRow("convert to camel case: wild mix") + << CppQuickFixFactoryPtr(new ConvertToCamelCase(true)) + << _("void @WhAt_TODO_hErE();\n") + << _("void WhAtTODOHErE();\n"); } void CppEditorPlugin::test_quickfix() |