summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qmlecmascript/data/methods.3.qml7
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp7
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/methods.3.qml b/tests/auto/declarative/qmlecmascript/data/methods.3.qml
new file mode 100644
index 0000000..2efcf6a
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/methods.3.qml
@@ -0,0 +1,7 @@
+import Qt 4.6
+
+Object {
+ function testFunction() { return 19; }
+
+ property int test: testFunction()
+}
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index a0e65c5..67a98b1 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -152,6 +152,13 @@ void tst_qmlecmascript::methods()
QCOMPARE(object->methodCalled(), false);
QCOMPARE(object->methodIntCalled(), true);
}
+
+ {
+ QmlComponent component(&engine, TEST_FILE("methods.3.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("test").toInt(), 19);
+ }
}
void tst_qmlecmascript::bindingLoop()