MCPcopy Create free account
hub / github.com/KDE/kdevelop / testAnnotation

Method testAnnotation

plugins/bazaar/tests/test_bazaar.cpp:235–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void TestBazaar::testAnnotation()
236{
237 repoInit();
238 addFiles();
239 commitFiles();
240
241 // called after commitFiles
242 QFile f(bazaarTest_BaseDir + bazaarTest_FileName);
243 QVERIFY(f.open(QIODevice::Append));
244 QTextStream input(&f);
245 input << "An appended line";
246 f.close();
247
248 VcsJob* j = m_plugin->commit(QStringLiteral("KDevelop's Test commit3"), QList<QUrl>() << QUrl::fromLocalFile(bazaarTest_BaseDir));
249 VERIFYJOB(j);
250
251 j = m_plugin->annotate(QUrl::fromLocalFile(bazaarTest_BaseDir + bazaarTest_FileName), VcsRevision::createSpecialRevision(VcsRevision::Head));
252 VERIFYJOB(j);
253
254 QList<QVariant> results = j->fetchResults().toList();
255 QCOMPARE(results.size(), 2);
256 QVERIFY(results.at(0).canConvert<VcsAnnotationLine>());
257 VcsAnnotationLine annotation = results.at(0).value<VcsAnnotationLine>();
258 QCOMPARE(annotation.lineNumber(), 0);
259 QCOMPARE(annotation.commitMessage(), QStringLiteral("KDevelop's Test commit2"));
260
261 QVERIFY(results.at(1).canConvert<VcsAnnotationLine>());
262 annotation = results.at(1).value<VcsAnnotationLine>();
263 QCOMPARE(annotation.lineNumber(), 1);
264 QCOMPARE(annotation.commitMessage(), QStringLiteral("KDevelop's Test commit3"));
265}
266
267void TestBazaar::testRemoveEmptyFolder()
268{

Callers

nothing calls this directly

Calls 10

openMethod · 0.45
closeMethod · 0.45
commitMethod · 0.45
annotateMethod · 0.45
toListMethod · 0.45
fetchResultsMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45
lineNumberMethod · 0.45
commitMessageMethod · 0.45

Tested by

no test coverage detected