summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptengine
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2011-02-01 13:50:26 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2011-02-01 13:54:49 (GMT)
commit70727b3cd373c66aa8a4883ca05a9eaf1f0a0d6d (patch)
treed3091dada2b14d8a49f36a98df41fc9bc90b93f8 /tests/auto/qscriptengine
parent363d983f2f65e9b7bdc440d1c4f7b98fafc284bb (diff)
downloadQt-70727b3cd373c66aa8a4883ca05a9eaf1f0a0d6d.zip
Qt-70727b3cd373c66aa8a4883ca05a9eaf1f0a0d6d.tar.gz
Qt-70727b3cd373c66aa8a4883ca05a9eaf1f0a0d6d.tar.bz2
Refactoring of tst_QScriptEngine::automaticSemicolonInsertion test.
Test shouldn't relay on error message, but on error type. Reviewed-by: Kent Hansen
Diffstat (limited to 'tests/auto/qscriptengine')
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index c4c53e9..956f06c 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -3018,7 +3018,7 @@ void tst_QScriptEngine::automaticSemicolonInsertion()
{
QScriptValue ret = eng.evaluate("{ 1 2 } 3");
QVERIFY(ret.isError());
- QCOMPARE(ret.toString(), QString::fromLatin1("SyntaxError: Parse error"));
+ QVERIFY(ret.toString().contains("SyntaxError"));
}
{
QScriptValue ret = eng.evaluate("{ 1\n2 } 3");
@@ -3028,7 +3028,7 @@ void tst_QScriptEngine::automaticSemicolonInsertion()
{
QScriptValue ret = eng.evaluate("for (a; b\n)");
QVERIFY(ret.isError());
- QCOMPARE(ret.toString(), QString::fromLatin1("SyntaxError: Parse error"));
+ QVERIFY(ret.toString().contains("SyntaxError"));
}
{
QScriptValue ret = eng.evaluate("(function() { return\n1 + 2 })()");
@@ -3043,7 +3043,7 @@ void tst_QScriptEngine::automaticSemicolonInsertion()
{
QScriptValue ret = eng.evaluate("if (a > b)\nelse c = d");
QVERIFY(ret.isError());
- QCOMPARE(ret.toString(), QString::fromLatin1("SyntaxError: Parse error"));
+ QVERIFY(ret.toString().contains("SyntaxError"));
}
{
eng.evaluate("function c() { return { foo: function() { return 5; } } }");
@@ -3055,7 +3055,7 @@ void tst_QScriptEngine::automaticSemicolonInsertion()
{
QScriptValue ret = eng.evaluate("throw\n1");
QVERIFY(ret.isError());
- QCOMPARE(ret.toString(), QString::fromLatin1("SyntaxError: Parse error"));
+ QVERIFY(ret.toString().contains("SyntaxError"));
}
{
QScriptValue ret = eng.evaluate("a = Number(1)\n++a");