diff options
Diffstat (limited to 'tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp')
-rw-r--r-- | tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp index df1e14f..82c66f8 100644 --- a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp +++ b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp @@ -95,6 +95,7 @@ private slots: void builtinFunctionNames(); void nullContext(); void streaming(); + void assignmentAndComparison(); }; tst_QScriptContextInfo::tst_QScriptContextInfo() @@ -553,5 +554,24 @@ void tst_QScriptContextInfo::streaming() } } +void tst_QScriptContextInfo::assignmentAndComparison() +{ + QScriptEngine eng; + eng.globalObject().setProperty("getContextInfoList", eng.newFunction(getContextInfoList)); + QString fileName = "ciao.qs"; + int lineNumber = 456; + QScriptValue ret = eng.evaluate("function bar(a, b, c) {\n return getContextInfoList();\n}\nbar()", + fileName, lineNumber); + QList<QScriptContextInfo> lst = qscriptvalue_cast<QList<QScriptContextInfo> >(ret); + QCOMPARE(lst.size(), 3); + QScriptContextInfo ci = lst.at(0); + QScriptContextInfo same = ci; + QVERIFY(ci == same); + QVERIFY(!(ci != same)); + QScriptContextInfo other = lst.at(1); + QVERIFY(!(ci == other)); + QVERIFY(ci != other); +} + QTEST_MAIN(tst_QScriptContextInfo) #include "tst_qscriptcontextinfo.moc" |