From 0516ee1ac75d000573ec0592d6c754dd176250a7 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 25 Sep 2009 11:44:01 +0200 Subject: add test case for wrong error message in qtscript --- tests/auto/qscriptengine/tst_qscriptengine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 4d693af9b9..183aa3fca2 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -95,6 +95,7 @@ private slots: void evaluate(); void nestedEvaluate(); void uncaughtException(); + void errorMessage_QT679(); void valueConversion(); void importExtension(); void infiniteRecursion(); @@ -1625,6 +1626,16 @@ void tst_QScriptEngine::uncaughtException() } } +void tst_QScriptEngine::errorMessage_QT679() +{ + QScriptEngine engine; + engine.globalObject().setProperty("foo", 15); + QScriptValue error = engine.evaluate("'hello world';\nfoo.bar.blah"); + QVERIFY(error.isError()); + QEXPECT_FAIL("", "Task QT-679: the error message always contains the first line of the script, even if the error was on a different line", Continue); + QCOMPARE(error.toString(), QString::fromLatin1("TypeError: Result of expression 'foo.bar' [undefined] is not an object.")); +} + struct Foo { public: int x, y; -- cgit v1.2.3