diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/date.qml | 6 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/date.qml b/tests/auto/qml/qqmlecmascript/data/date.qml index 0dcba71ae3..41dcaafa33 100644 --- a/tests/auto/qml/qqmlecmascript/data/date.qml +++ b/tests/auto/qml/qqmlecmascript/data/date.qml @@ -17,4 +17,10 @@ Item { var dt = new Date(""); return isNaN(dt); } + + function test_rfc2822_date() + { + var dt = new Date("Wed, 18 Sep 2013 07:00:51 -0700"); + return dt.getTime(); + } } diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 019d6790e1..38a2affe3a 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -7361,7 +7361,8 @@ void tst_qqmlecmascript::dateParse() QMetaObject::invokeMethod(object, "test_is_invalid_qtDateTime", Q_RETURN_ARG(QVariant, q)); QVERIFY(q.toBool() == true); - + QMetaObject::invokeMethod(object, "test_rfc2822_date", Q_RETURN_ARG(QVariant, q)); + QCOMPARE(q.toLongLong(), 1379512851000LL); } void tst_qqmlecmascript::utcDate() |