summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptengine
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-09-25 09:44:01 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-09-25 09:44:57 (GMT)
commit0516ee1ac75d000573ec0592d6c754dd176250a7 (patch)
treefdc8e60f14fe1ed6cd14155d808547295a7f7639 /tests/auto/qscriptengine
parent03abf8a298193c3e77896b99bac047b542424bbd (diff)
downloadQt-0516ee1ac75d000573ec0592d6c754dd176250a7.zip
Qt-0516ee1ac75d000573ec0592d6c754dd176250a7.tar.gz
Qt-0516ee1ac75d000573ec0592d6c754dd176250a7.tar.bz2
add test case for wrong error message in qtscript
Diffstat (limited to 'tests/auto/qscriptengine')
-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 4d693af..183aa3f 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;