From 06f033bc8446d6b82bf68a2a0766b75836e005db Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 30 Jul 2009 17:26:49 +0200 Subject: update test to match JSC __defineSetter__() behavior --- tests/auto/qscriptengine/tst_qscriptengine.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 9067005..1f7a857 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -3232,18 +3232,16 @@ void tst_QScriptEngine::getterSetterThisObject() // read eng.evaluate("act.__defineGetter__('x', function() { return this; })"); QVERIFY(eng.evaluate("x === act").toBoolean()); - QEXPECT_FAIL("", "", Continue); - QVERIFY(eng.evaluate("with (act) x").equals(eng.evaluate("act"))); + QEXPECT_FAIL("", "Exotic overload (don't care for now)", Continue); + QVERIFY(eng.evaluate("with (act) x").equals("foo")); QVERIFY(eng.evaluate("(function() { with (act) return x; })() === act").toBoolean()); eng.evaluate("q = {}; with (act) with (q) x").equals(eng.evaluate("act")); eng.evaluate("with (q) with (act) x").equals(eng.evaluate("act")); // write eng.evaluate("act.__defineSetter__('x', function() { return this; });"); - QVERIFY(eng.evaluate("(x = 'foo') === act").toBoolean()); - QEXPECT_FAIL("", "", Continue); - QVERIFY(eng.evaluate("with (act) x = 'foo'").equals(eng.evaluate("act"))); - QEXPECT_FAIL("", "", Continue); - QVERIFY(eng.evaluate("with (act) with (q) x = 'foo'").equals(eng.evaluate("act"))); + QVERIFY(eng.evaluate("(x = 'foo') === 'foo'").toBoolean()); + QVERIFY(eng.evaluate("with (act) x = 'foo'").equals("foo")); + QVERIFY(eng.evaluate("with (act) with (q) x = 'foo'").equals("foo")); eng.popContext(); } } -- cgit v0.12