summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/tst_DownloadUpdateTask.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tst_DownloadUpdateTask.cpp b/tests/tst_DownloadUpdateTask.cpp
index f47552fe..3b2c6793 100644
--- a/tests/tst_DownloadUpdateTask.cpp
+++ b/tests/tst_DownloadUpdateTask.cpp
@@ -245,6 +245,25 @@ slots:
QVERIFY(succeededSpy.wait());
}
+
+ void test_OSXPathFixup()
+ {
+ QString path, pathOrig;
+ bool result;
+ // Proper OSX path
+ pathOrig = path = "MultiMC.app/Foo/Bar/Baz";
+ qDebug() << "Proper OSX path: " << path;
+ result = DownloadUpdateTask::fixPathForOSX(path);
+ QCOMPARE(path, QString("../../Foo/Bar/Baz"));
+ QCOMPARE(result, true);
+
+ // Bad OSX path
+ pathOrig = path = "translations/klingon.lol";
+ qDebug() << "Bad OSX path: " << path;
+ result = DownloadUpdateTask::fixPathForOSX(path);
+ QCOMPARE(path, pathOrig);
+ QCOMPARE(result, false);
+ }
};
QTEST_GUILESS_MAIN_MULTIMC(DownloadUpdateTaskTest)