aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDioEgizio <83089242+DioEgizio@users.noreply.github.com>2022-10-18 15:27:53 +0200
committerGitHub <noreply@github.com>2022-10-18 15:27:53 +0200
commit194822f11eef051c2f323a8e31cd785876a4dbcf (patch)
tree589593bc2275a71c19e200c06be2ef34b18cf7c6 /tests
parent98963d4cdf94b173c68bb7c67feb68f6a73d4495 (diff)
parent82d7f9f5a46fe0d66aa907825cf784efc13f8792 (diff)
downloadPrismLauncher-194822f11eef051c2f323a8e31cd785876a4dbcf.tar.gz
PrismLauncher-194822f11eef051c2f323a8e31cd785876a4dbcf.tar.bz2
PrismLauncher-194822f11eef051c2f323a8e31cd785876a4dbcf.zip
Merge pull request #28 from flowln/fix_copy
Diffstat (limited to 'tests')
-rw-r--r--tests/FileSystem_test.cpp36
-rw-r--r--tests/testdata/FileSystem/test_folder/.secret_folder/.secret_file.txt1
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/FileSystem_test.cpp b/tests/FileSystem_test.cpp
index 4efb90ac..47a963b0 100644
--- a/tests/FileSystem_test.cpp
+++ b/tests/FileSystem_test.cpp
@@ -147,6 +147,42 @@ slots:
f();
}
+ void test_copy_with_dot_hidden()
+ {
+ QString folder = QFINDTESTDATA("testdata/FileSystem/test_folder");
+ auto f = [&folder]()
+ {
+ QTemporaryDir tempDir;
+ tempDir.setAutoRemove(true);
+ qDebug() << "From:" << folder << "To:" << tempDir.path();
+
+ QDir target_dir(FS::PathCombine(tempDir.path(), "test_folder"));
+ qDebug() << tempDir.path();
+ qDebug() << target_dir.path();
+ FS::copy c(folder, target_dir.path());
+ c();
+
+ auto filter = QDir::Filter::Files | QDir::Filter::Dirs | QDir::Filter::Hidden;
+
+ for (auto entry: target_dir.entryList(filter)) {
+ qDebug() << entry;
+ }
+
+ QVERIFY(target_dir.entryList(filter).contains(".secret_folder"));
+ target_dir.cd(".secret_folder");
+ QVERIFY(target_dir.entryList(filter).contains(".secret_file.txt"));
+ };
+
+ // first try variant without trailing /
+ QVERIFY(!folder.endsWith('/'));
+ f();
+
+ // then variant with trailing /
+ folder.append('/');
+ QVERIFY(folder.endsWith('/'));
+ f();
+ }
+
void test_getDesktop()
{
QCOMPARE(FS::getDesktopDir(), QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
diff --git a/tests/testdata/FileSystem/test_folder/.secret_folder/.secret_file.txt b/tests/testdata/FileSystem/test_folder/.secret_folder/.secret_file.txt
new file mode 100644
index 00000000..65e37085
--- /dev/null
+++ b/tests/testdata/FileSystem/test_folder/.secret_folder/.secret_file.txt
@@ -0,0 +1 @@
+oooooo spooky easter egg :oo