summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptengine
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-28 07:23:31 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-28 09:22:59 (GMT)
commita10d523c5010e46b86a74d111342b1b26891cbdf (patch)
tree06d7ca39e751bc8441f262f0be14b2385795fcba /tests/auto/qscriptengine
parent102493fd341a322a369d21414fdb10aedaf23ff5 (diff)
downloadQt-a10d523c5010e46b86a74d111342b1b26891cbdf.zip
Qt-a10d523c5010e46b86a74d111342b1b26891cbdf.tar.gz
Qt-a10d523c5010e46b86a74d111342b1b26891cbdf.tar.bz2
Change JavaScriptCore so it throw error when passing invalid regexp flag
As specified in the specification. The QScriptEngine::newRegExp on the other hand used to work with invalid flags. Reviewed-by: Kent Hansen
Diffstat (limited to 'tests/auto/qscriptengine')
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index d657749..b52051f 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -491,16 +491,12 @@ void tst_QScriptEngine::newRegExp()
QVERIFY(!r5.strictlyEquals(r));
QScriptValue r6 = rxCtor.construct(QScriptValueList() << "foo" << "bar");
- QEXPECT_FAIL("", "JSC doesn't throw error for invalid regexp flags", Continue);
QVERIFY(r6.isError());
- QEXPECT_FAIL("", "JSC doesn't throw error for invalid regexp flags", Continue);
- QCOMPARE(r6.toString(), QString::fromLatin1("SyntaxError: invalid regular expression flag 'b'"));
+ QCOMPARE(r6.toString(), QString::fromLatin1("SyntaxError: Invalid regular expression: invalid regular expression flag"));
QScriptValue r7 = eng.evaluate("/foo/gimp");
- QEXPECT_FAIL("", "JSC doesn't throw error for invalid regexp flags", Continue);
QVERIFY(r7.isError());
- QEXPECT_FAIL("", "JSC doesn't throw error for invalid regexp flags", Continue);
- QCOMPARE(r7.toString(), QString::fromLatin1("SyntaxError: Invalid regular expression flag 'p'"));
+ QCOMPARE(r7.toString(), QString::fromLatin1("SyntaxError: Invalid regular expression: invalid regular expression flag"));
QScriptValue r8 = eng.evaluate("/foo/migmigmig");
QVERIFY(r8.isRegExp());