Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-06-02 21:20:19 +0300
committerGitHub <noreply@github.com>2018-06-02 21:20:19 +0300
commit1262cbf4ef23c78764f1debde24f67f843a8bc1f (patch)
tree29f1a0542e0c0f06286c708c20f7e77480045678 /test
parentb2433c8961ad37554ee0c34b6e1dd1553c97bb5d (diff)
parent1868b2f3ecd563693f03a9bcbb8ed10554b9b06c (diff)
Merge pull request #314 from nextcloud/upstream/pr/6373
Make sure ignored and conflict files show up in the issues tab even with partial local discovery
Diffstat (limited to 'test')
-rw-r--r--test/testsyncengine.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/testsyncengine.cpp b/test/testsyncengine.cpp
index 3730eb004..f546b56a9 100644
--- a/test/testsyncengine.cpp
+++ b/test/testsyncengine.cpp
@@ -605,6 +605,38 @@ private slots:
QCOMPARE(fakeFolder.syncEngine().lastLocalDiscoveryStyle(), LocalDiscoveryStyle::FilesystemOnly);
}
+ void testLocalDiscoveryDecision()
+ {
+ FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
+ auto &engine = fakeFolder.syncEngine();
+
+ QVERIFY(engine.shouldDiscoverLocally(""));
+ QVERIFY(engine.shouldDiscoverLocally("A"));
+ QVERIFY(engine.shouldDiscoverLocally("A/X"));
+
+ fakeFolder.syncEngine().setLocalDiscoveryOptions(
+ LocalDiscoveryStyle::DatabaseAndFilesystem,
+ { "A/X", "foo bar space/touch", "foo/", "zzz" });
+
+ QVERIFY(engine.shouldDiscoverLocally(""));
+ QVERIFY(engine.shouldDiscoverLocally("A"));
+ QVERIFY(engine.shouldDiscoverLocally("A/X"));
+ QVERIFY(!engine.shouldDiscoverLocally("B"));
+ QVERIFY(!engine.shouldDiscoverLocally("A B"));
+ QVERIFY(!engine.shouldDiscoverLocally("B/X"));
+ QVERIFY(!engine.shouldDiscoverLocally("A/X/Y"));
+ QVERIFY(engine.shouldDiscoverLocally("foo bar space"));
+ QVERIFY(engine.shouldDiscoverLocally("foo"));
+ QVERIFY(!engine.shouldDiscoverLocally("foo bar"));
+ QVERIFY(!engine.shouldDiscoverLocally("foo bar/touch"));
+
+ fakeFolder.syncEngine().setLocalDiscoveryOptions(
+ LocalDiscoveryStyle::DatabaseAndFilesystem,
+ {});
+
+ QVERIFY(!engine.shouldDiscoverLocally(""));
+ }
+
void testDiscoveryHiddenFile()
{
FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };