aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index aaa72d48cd..b3b31e1a73 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -7427,8 +7427,11 @@ void tst_qqmlecmascript::negativeYear()
QVariant q;
QMetaObject::invokeMethod(object, "check_negative_tostring", Q_RETURN_ARG(QVariant, q));
- // Strip the timezone. It should be irrelevant as the date was created with the same one.
- QCOMPARE(q.toString().left(32), QStringLiteral("result: Sat Jan 1 00:00:00 -2001"));
+
+ // Only check for the year. We hope that every language writes the year in arabic numerals and
+ // in relation to a specific dude's date of birth. We also hope that no language adds a "-2001"
+ // junk string somewhere in the middle.
+ QVERIFY(q.toString().indexOf(QStringLiteral("-2001")) != -1);
QMetaObject::invokeMethod(object, "check_negative_toisostring", Q_RETURN_ARG(QVariant, q));
QCOMPARE(q.toString().left(16), QStringLiteral("result: -002000-"));