Skip to content

Commit

Permalink
Provide Windows-compatible forbidden filename character in forbidden …
Browse files Browse the repository at this point in the history
…filenames test

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Aug 6, 2024
1 parent 23bd176 commit 7d3b09b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/testlocaldiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ private slots:
fakeFolder.syncEngine().account()->setCapabilities({
{ "files", QVariantMap {
{ "forbidden_filenames", QVariantList { ".foo", "bar" } },
{ "forbidden_filename_characters", QVariantList { "\n" } },
{ "forbidden_filename_characters", QVariantList { "_" } },
{ "forbidden_filename_basenames", QVariantList { "base" } },
{ "forbidden_filename_extensions", QVariantList { "ext" } }
} }
Expand All @@ -314,7 +314,7 @@ private slots:
fakeFolder.localModifier().insert("C/moo");
fakeFolder.localModifier().insert("C/.moo");
fakeFolder.localModifier().insert("C/potatopotato.txt");
fakeFolder.localModifier().insert("C/potato\npotato.txt");
fakeFolder.localModifier().insert("C/potato_potato.txt");
fakeFolder.localModifier().insert("C/basefilename.txt");
fakeFolder.localModifier().insert("C/base.txt");
fakeFolder.localModifier().insert("C/filename.txt");
Expand All @@ -326,12 +326,13 @@ private slots:
QVERIFY(!fakeFolder.currentRemoteState().find("C/.foo"));
QVERIFY(!fakeFolder.currentRemoteState().find("C/bar"));
QVERIFY(fakeFolder.currentRemoteState().find("C/potatopotato.txt"));
QVERIFY(!fakeFolder.currentRemoteState().find("C/potato\npotato.txt"));
QVERIFY(!fakeFolder.currentRemoteState().find("C/potato_potato.txt"));
QVERIFY(fakeFolder.currentRemoteState().find("C/basefilename.txt"));
QVERIFY(!fakeFolder.currentRemoteState().find("C/base.txt"));
QVERIFY(fakeFolder.currentRemoteState().find("C/filename.txt"));
QVERIFY(!fakeFolder.currentRemoteState().find("C/filename.ext"));
}
#endif

void testCreateFileWithTrailingSpaces_localAndRemoteTrimmedDoNotExist_renameAndUploadFile()
{
Expand Down

0 comments on commit 7d3b09b

Please sign in to comment.