diff options
author | flow <flowlnlnln@gmail.com> | 2022-10-28 20:55:25 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-10-28 20:55:25 -0300 |
commit | 81333515e0ecfa0ad0880032808a220a3f463e30 (patch) | |
tree | 203f52fee69b28b0232c360c5e02d8e25261bed9 | |
parent | be3c9abcfeb68ad76914848e7135b2595490beda (diff) | |
download | PrismLauncher-81333515e0ecfa0ad0880032808a220a3f463e30.tar.gz PrismLauncher-81333515e0ecfa0ad0880032808a220a3f463e30.tar.bz2 PrismLauncher-81333515e0ecfa0ad0880032808a220a3f463e30.zip |
feat(tests): add test for FS::copy with files
Signed-off-by: flow <flowlnlnln@gmail.com>
-rw-r--r-- | tests/FileSystem_test.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/FileSystem_test.cpp b/tests/FileSystem_test.cpp index 47a963b0..21270f6f 100644 --- a/tests/FileSystem_test.cpp +++ b/tests/FileSystem_test.cpp @@ -183,6 +183,32 @@ slots: f(); } + void test_copy_single_file() + { + QTemporaryDir tempDir; + tempDir.setAutoRemove(true); + + { + QString file = QFINDTESTDATA("testdata/FileSystem/test_folder/pack.mcmeta"); + + qDebug() << "From:" << file << "To:" << tempDir.path(); + + QDir target_dir(FS::PathCombine(tempDir.path(), "pack.mcmeta")); + qDebug() << tempDir.path(); + qDebug() << target_dir.path(); + FS::copy c(file, target_dir.filePath("pack.mcmeta")); + c(); + + auto filter = QDir::Filter::Files; + + for (auto entry: target_dir.entryList(filter)) { + qDebug() << entry; + } + + QVERIFY(target_dir.entryList(filter).contains("pack.mcmeta")); + } + } + void test_getDesktop() { QCOMPARE(FS::getDesktopDir(), QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)); |