aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cvs/cvsplugin.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <[email protected]>2013-01-21 22:56:01 +0200
committerTobias Hunger <[email protected]>2013-01-22 13:38:01 +0100
commit3b66b11ac4d0c4c9728578be952f3e0356eaae62 (patch)
tree705a38e103a9a4fc36e1b6a6b3b4c8e029c70eef /src/plugins/cvs/cvsplugin.cpp
parent23844410fdc100342860e400a62e86c408ac4605 (diff)
VCS: Add diff pattern tests for CVS and Mercurial
* Fix Mercurial pattern * Make fileNameFromDiffSpecification protected again (it was made public for running tests, but they are now run from VCSBaseEditor) * Remove DiffHighlighter::filePattern(). Not used anymore. Change-Id: Ifc99f761f0ab96cc79f1d018e3f3c8cf4603da10 Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src/plugins/cvs/cvsplugin.cpp')
-rw-r--r--src/plugins/cvs/cvsplugin.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp
index d921d9efd49..2b99b0df0d9 100644
--- a/src/plugins/cvs/cvsplugin.cpp
+++ b/src/plugins/cvs/cvsplugin.cpp
@@ -71,6 +71,10 @@
#include <QMenu>
#include <QMessageBox>
+#ifdef WITH_TESTS
+#include <QTest>
+#endif
+
using namespace VcsBase;
using namespace Core;
@@ -1376,6 +1380,28 @@ CvsControl *CvsPlugin::cvsVersionControl() const
return static_cast<CvsControl *>(versionControl());
}
+#ifdef WITH_TESTS
+void CvsPlugin::testDiffFileResolving_data()
+{
+ QTest::addColumn<QByteArray>("header");
+ QTest::addColumn<QByteArray>("fileName");
+
+ QTest::newRow("Modified") << QByteArray(
+ "Index: src/plugins/cvs/cvseditor.cpp\n"
+ "===================================================================\n"
+ "--- src/plugins/cvs/cvseditor.cpp\t21 Jan 2013 20:34:20 -0000\t1.1\n"
+ "+++ src/plugins/cvs/cvseditor.cpp\t21 Jan 2013 20:34:28 -0000\n"
+ "@@ -120,7 +120,7 @@\n\n")
+ << QByteArray("src/plugins/cvs/cvseditor.cpp");
+}
+
+void CvsPlugin::testDiffFileResolving()
+{
+ CvsEditor editor(editorParameters + 3, 0);
+ VcsBase::VcsBaseEditorWidget::testDiffFileResolving(&editor);
+}
+#endif
+
} // namespace Internal
} // namespace Cvs