aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlparser/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlparser/data')
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/anonfunctionexpr.js3
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classmemberparam.js6
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classreturnvalue.js6
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/function.js4
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionexpr.js3
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionparams.js3
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration.js3
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration2.js5
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/qmlnestedfunction.qml9
-rw-r--r--tests/auto/qml/qqmlparser/data/disallowedtypeannotations/variables.js2
-rw-r--r--tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_bool.qml4
-rw-r--r--tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_double.qml4
-rw-r--r--tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_int.qml4
-rw-r--r--tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_real.qml4
-rw-r--r--tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_string.qml4
-rw-r--r--tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_url.qml4
-rw-r--r--tests/auto/qml/qqmlparser/data/typeannotations/parametrized.qml5
-rw-r--r--tests/auto/qml/qqmlparser/data/typeannotations/qmlfunction.qml6
18 files changed, 79 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/anonfunctionexpr.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/anonfunctionexpr.js
new file mode 100644
index 0000000000..f660edb69e
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/anonfunctionexpr.js
@@ -0,0 +1,3 @@
+(function () : string {
+ return "ko"
+})
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classmemberparam.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classmemberparam.js
new file mode 100644
index 0000000000..ab85d90880
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classmemberparam.js
@@ -0,0 +1,6 @@
+
+class Foo {
+ member(param: string) {
+ return "ko"
+ }
+}
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classreturnvalue.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classreturnvalue.js
new file mode 100644
index 0000000000..a7da9e0ca7
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classreturnvalue.js
@@ -0,0 +1,6 @@
+
+class Foo {
+ member(): string {
+ return "ko"
+ }
+}
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/function.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/function.js
new file mode 100644
index 0000000000..4d6021e835
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/function.js
@@ -0,0 +1,4 @@
+
+function x() : string {
+ return "ok"
+}
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionexpr.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionexpr.js
new file mode 100644
index 0000000000..33f2abbb61
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionexpr.js
@@ -0,0 +1,3 @@
+(function x() : string {
+ return "ko"
+})
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionparams.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionparams.js
new file mode 100644
index 0000000000..2c23628e3f
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionparams.js
@@ -0,0 +1,3 @@
+
+function test(x: string, y: string) {
+}
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration.js
new file mode 100644
index 0000000000..a6cc00e38a
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration.js
@@ -0,0 +1,3 @@
+
+for (var i: int = 0; i < 100; ++i) {
+}
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration2.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration2.js
new file mode 100644
index 0000000000..24d5acce98
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration2.js
@@ -0,0 +1,5 @@
+
+let y = [1, 2, 3];
+
+for (let x: int of y) {
+}
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/qmlnestedfunction.qml b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/qmlnestedfunction.qml
new file mode 100644
index 0000000000..f435bf1b25
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/qmlnestedfunction.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.12 as MyQuick
+MyQuick.Item {
+ function factory(param: string) : MyQuick.Item {
+ function nested(foo: string) {
+ return this
+ }
+ return nested()
+ }
+}
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/variables.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/variables.js
new file mode 100644
index 0000000000..bf332ac7a8
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/variables.js
@@ -0,0 +1,2 @@
+
+var x: string = "ko"
diff --git a/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_bool.qml b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_bool.qml
new file mode 100644
index 0000000000..79a9ede3d4
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_bool.qml
@@ -0,0 +1,4 @@
+import QtQml 2.0
+QtObject {
+ function test() : bool { return true; }
+}
diff --git a/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_double.qml b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_double.qml
new file mode 100644
index 0000000000..f58e4b92d9
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_double.qml
@@ -0,0 +1,4 @@
+import QtQml 2.0
+QtObject {
+ function test() : double { return 0; }
+}
diff --git a/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_int.qml b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_int.qml
new file mode 100644
index 0000000000..267ad7191f
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_int.qml
@@ -0,0 +1,4 @@
+import QtQml 2.0
+QtObject {
+ function test() : int { return 0; }
+}
diff --git a/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_real.qml b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_real.qml
new file mode 100644
index 0000000000..9973819ad2
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_real.qml
@@ -0,0 +1,4 @@
+import QtQml 2.0
+QtObject {
+ function test() : real { return 0; }
+}
diff --git a/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_string.qml b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_string.qml
new file mode 100644
index 0000000000..e632ec7154
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_string.qml
@@ -0,0 +1,4 @@
+import QtQml 2.0
+QtObject {
+ function test(s: string) {}
+}
diff --git a/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_url.qml b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_url.qml
new file mode 100644
index 0000000000..ebf3f32561
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/typeannotations/basic_qmltypes_url.qml
@@ -0,0 +1,4 @@
+import QtQml 2.0
+QtObject {
+ function test(u: url) {}
+}
diff --git a/tests/auto/qml/qqmlparser/data/typeannotations/parametrized.qml b/tests/auto/qml/qqmlparser/data/typeannotations/parametrized.qml
new file mode 100644
index 0000000000..d80b5e3f87
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/typeannotations/parametrized.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0 as MyQuick
+MyQuick.Item {
+ function factory() : list<MyQuick.Item> {
+ }
+}
diff --git a/tests/auto/qml/qqmlparser/data/typeannotations/qmlfunction.qml b/tests/auto/qml/qqmlparser/data/typeannotations/qmlfunction.qml
new file mode 100644
index 0000000000..cd5c1f51e5
--- /dev/null
+++ b/tests/auto/qml/qqmlparser/data/typeannotations/qmlfunction.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.12 as MyQuick
+MyQuick.Item {
+ function factory(param: string) : MyQuick.Item {
+ return this
+ }
+}