summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/zero-length-duration-result.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/zero-length-duration-result.js')
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/zero-length-duration-result.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/zero-length-duration-result.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/zero-length-duration-result.js
new file mode 100644
index 0000000000..b4aa45e979
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/zero-length-duration-result.js
@@ -0,0 +1,19 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: The duration from a date to itself is a zero duration (PT0S)
+esid: sec-temporal.calendar.prototype.dateuntil
+features: [Temporal]
+---*/
+
+const instance = new Temporal.Calendar("gregory");
+const date = new Temporal.PlainDate(2001, 6, 3);
+
+['year', 'month', 'week', 'day'].forEach((largestUnit) => {
+ const result = instance.dateUntil(date, date, { largestUnit });
+ assert.sameValue(result.toString(), 'PT0S');
+});
+
+reportCompare(0, 0);