aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/checkDate-denormal-leap.qml
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-10-07 11:09:47 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-10-08 21:21:29 +0200
commit290dc2da70655db9d4590600dfd37b825b81c1f8 (patch)
tree7f02b2496f5db4e18ef65ff76e52b2dcef1e1e6a /tests/auto/qml/qqmlecmascript/data/checkDate-denormal-leap.qml
parent8b9a67dd7b2c270f00bc48e1aa3cff50cdf058e9 (diff)
Be more fussy about the MakeDay() calculation
The ES Date spec goes into minute detail about doing various algorithms in the dumbest possible way (like InLeapYear() calling DaysInYear(), rather than the other way round) but, in MakeDay(), leaves the implementation to solve the problem of finding the start of the first day of a specified month in a given year. So exercise the freedom we have in that to be a little more robust; and actually check we have met the conditions the spec requires, returning NaN (as specified) if not. Added tests for some denormal dates and date-times and for a date mentioned in QTBUG-78996. Task-number: QTBUG-78996 Change-Id: I8d9a841dd1f1d9995273a3de8f6f9130207c7c2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/checkDate-denormal-leap.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/checkDate-denormal-leap.qml11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/checkDate-denormal-leap.qml b/tests/auto/qml/qqmlecmascript/data/checkDate-denormal-leap.qml
new file mode 100644
index 0000000000..6dd84810e6
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/checkDate-denormal-leap.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import QtQuick 2.0
+
+MyTypeObject {
+ Component.onCompleted: {
+ dateProperty = new Date(2020, 2, 0) // Feb 29th
+ boolProperty = (dateProperty.getFullYear() == 2020
+ && dateProperty.getMonth() == 1
+ && dateProperty.getDate() == 29)
+ }
+}