| 590 | } |
| 591 | |
| 592 | void test_link_single_file() |
| 593 | { |
| 594 | QTemporaryDir tempDir; |
| 595 | tempDir.setAutoRemove(true); |
| 596 | |
| 597 | { |
| 598 | QString file = QFINDTESTDATA("testdata/FileSystem/test_folder/pack.mcmeta"); |
| 599 | |
| 600 | qDebug() << "From:" << file << "To:" << tempDir.path(); |
| 601 | |
| 602 | QDir target_dir(FS::PathCombine(tempDir.path(), "pack.mcmeta")); |
| 603 | qDebug() << tempDir.path(); |
| 604 | qDebug() << target_dir.path(); |
| 605 | |
| 606 | LinkTask lnk_tsk(file, target_dir.filePath("pack.mcmeta")); |
| 607 | QObject::connect(&lnk_tsk, &Task::finished, |
| 608 | [&] { QVERIFY2(lnk_tsk.wasSuccessful(), "Task finished but was not successful when it should have been."); }); |
| 609 | lnk_tsk.start(); |
| 610 | |
| 611 | QVERIFY2(QTest::qWaitFor([&]() { return lnk_tsk.isFinished(); }, 100000), "Task didn't finish as it should."); |
| 612 | |
| 613 | auto filter = QDir::Filter::Files; |
| 614 | |
| 615 | for (auto entry : target_dir.entryList(filter)) { |
| 616 | qDebug() << entry; |
| 617 | } |
| 618 | |
| 619 | QFileInfo lnk_info(target_dir.filePath("pack.mcmeta")); |
| 620 | QVERIFY(lnk_info.exists()); |
| 621 | QVERIFY(lnk_info.isSymLink()); |
| 622 | |
| 623 | QVERIFY(target_dir.entryList(filter).contains("pack.mcmeta")); |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | void test_link_with_max_depth() |
| 628 | { |
nothing calls this directly
no test coverage detected