fix(search): make stop interrupt all phases
ci-release / verify (push) Successful in 33s
ci-release / publish-linux-amd64 (push) Has been skipped

This commit is contained in:
2026-07-25 22:22:03 +02:00
parent 79001370b8
commit afb089bee6
4 changed files with 111 additions and 23 deletions
+18
View File
@@ -90,6 +90,24 @@ private slots:
QVERIFY(!filesEqual(firstPath, differentPath));
QCOMPARE(sha256(firstPath), QCryptographicHash::hash(content, QCryptographicHash::Sha256));
}
void cancelsFileOperations()
{
QTemporaryDir directory;
QVERIFY(directory.isValid());
const QString path = directory.filePath(QStringLiteral("file.bin"));
QFile file(path);
QVERIFY(file.open(QIODevice::WriteOnly));
QCOMPARE(file.write("needle"), qint64(6));
file.close();
std::atomic_bool cancelled = true;
SearchOptions options;
options.contains = QStringLiteral("needle");
QVERIFY(!fileContains(path, options, &cancelled));
QVERIFY(!filesEqual(path, path, &cancelled));
QVERIFY(sha256(path, &cancelled).isEmpty());
}
};
QTEST_GUILESS_MAIN(SearchCoreTest)