aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-01-04 17:12:16 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-18 21:07:33 +0000
commit838ad1a8d0e9ea4eb62c2428d57b54df4d860c32 (patch)
tree1329647319b9ad125f0507f84477a50e82414972 /tests
parent4148fe5765842d5a6c378cf68c0bd8b230452d1c (diff)
QmlCompiler: Construct multi-part URIs with '.' rather than '/'
This is how URIs are defined and how we store them in our caches. Without this, we cannot find modules with multi-part URIs imported using -i. Change-Id: I86b02b2c2102a2d4edd8c20388c6cd9b1e92b0ff Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b245faae89f3b76890a9b49a2a1a5ee4b1568d28) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmllint/data/Elsewhere/B.qml3
-rw-r--r--tests/auto/qml/qmllint/data/Elsewhere/qmldir2
-rw-r--r--tests/auto/qml/qmllint/data/here.qml3
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp9
4 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/Elsewhere/B.qml b/tests/auto/qml/qmllint/data/Elsewhere/B.qml
new file mode 100644
index 0000000000..8fc36a40da
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Elsewhere/B.qml
@@ -0,0 +1,3 @@
+import QtQml
+
+QtObject {}
diff --git a/tests/auto/qml/qmllint/data/Elsewhere/qmldir b/tests/auto/qml/qmllint/data/Elsewhere/qmldir
new file mode 100644
index 0000000000..e38f7da9ce
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Elsewhere/qmldir
@@ -0,0 +1,2 @@
+module Things.Nested
+A 1.0 B.qml
diff --git a/tests/auto/qml/qmllint/data/here.qml b/tests/auto/qml/qmllint/data/here.qml
new file mode 100644
index 0000000000..1ead2eedd1
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/here.qml
@@ -0,0 +1,3 @@
+import Things.Nested
+
+A {}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 9c574cd252..aa54eea62c 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -92,6 +92,8 @@ private Q_SLOTS:
void javascriptVariableArgs();
void unknownTypeInRegister();
+ void importMultipartUri();
+
private:
enum DefaultIncludeOption { NoDefaultIncludes, UseDefaultIncludes };
enum ContainOption { StringNotContained, StringContained };
@@ -1299,5 +1301,12 @@ void TestQmllint::unknownTypeInRegister()
"Functions without type annotations won't be compiled")));
}
+void TestQmllint::importMultipartUri()
+{
+ QJsonArray warnings;
+ callQmllint("here.qml", true, &warnings, {}, { testFile("Elsewhere/qmldir") });
+ QVERIFY(warnings.isEmpty());
+}
+
QTEST_MAIN(TestQmllint)
#include "tst_qmllint.moc"