summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptengine/tst_qscriptengine.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-09-25 11:44:01 +0200
committerKent Hansen <khansen@trolltech.com>2009-09-25 11:44:57 +0200
commit0516ee1ac75d000573ec0592d6c754dd176250a7 (patch)
treefdc8e60f14fe1ed6cd14155d808547295a7f7639 /tests/auto/qscriptengine/tst_qscriptengine.cpp
parent03abf8a298193c3e77896b99bac047b542424bbd (diff)
add test case for wrong error message in qtscript
Diffstat (limited to 'tests/auto/qscriptengine/tst_qscriptengine.cpp')
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp11
1 files changed, 11 insertions, 0 deletions
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;