diff --git a/tests/packagestructuretest.cpp b/tests/packagestructuretest.cpp index e22130fbd..9ec445900 100644 --- a/tests/packagestructuretest.cpp +++ b/tests/packagestructuretest.cpp @@ -23,9 +23,22 @@ #include #include +#include "plasma/package.h" #include "plasma/packagestructure.h" #include "plasma/applet.h" +class NoPrefixes : public Plasma::PackageStructure +{ +public: + explicit NoPrefixes() + : Plasma::PackageStructure(0, "StructureLess") + { + setContentsPrefixPaths(QStringList()); + addDirectoryDefinition("bin", "bin", "bin"); + } +}; + + void PackageStructureTest::init() { ps = Plasma::Applet::packageStructure(); @@ -35,6 +48,15 @@ void PackageStructureTest::cleanup() { } +void PackageStructureTest::emptyContentsPrefix() +{ + Plasma::PackageStructure::Ptr structure(new NoPrefixes); + Plasma::Package package("/", structure); + QString path(package.filePath("bin", "ls")); + qDebug() << path; + QCOMPARE(path, QString("/bin/ls")); +} + void PackageStructureTest::type() { QCOMPARE(ps->type(), QString("Plasmoid")); diff --git a/tests/packagestructuretest.h b/tests/packagestructuretest.h index 8cecb9df1..7d0cdfaaa 100644 --- a/tests/packagestructuretest.h +++ b/tests/packagestructuretest.h @@ -32,6 +32,7 @@ public Q_SLOTS: void cleanup(); private Q_SLOTS: + void emptyContentsPrefix(); void type(); void directories(); void requiredDirectories();