summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qmlecmascript/data/attachedProperty.qml11
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp14
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml b/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml
new file mode 100644
index 0000000..c5088e3
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ id: Me
+ property int a: MyQmlObject.value
+ property int b: Namespace.MyQmlObject.value
+ property int c: Me.Namespace.MyQmlObject.value
+ property int d: Me.Namespace.MyQmlObject.value
+}
+
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index d5d20b6..eca4b92 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -44,6 +44,7 @@ private slots:
void objectPropertiesTriggerReeval();
void deferredProperties();
void extensionObjects();
+ void attachedProperties();
void enums();
void valueTypeFunctions();
void constantsOverrideBindings();
@@ -379,6 +380,19 @@ void tst_qmlecmascript::extensionObjects()
QCOMPARE(object->baseProperty(), 92);
}
+void tst_qmlecmascript::attachedProperties()
+{
+ QmlComponent component(&engine, TEST_FILE("attachedProperty.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("a").toInt(), 19);
+ QCOMPARE(object->property("b").toInt(), 19);
+ QCOMPARE(object->property("c").toInt(), 19);
+ QCOMPARE(object->property("d").toInt(), 19);
+
+ // ### Need to test attached property assignment
+}
+
void tst_qmlecmascript::enums()
{
// Existant enums