summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/equals/offset-and-iana.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/Temporal/TimeZone/prototype/equals/offset-and-iana.js')
-rw-r--r--js/src/tests/test262/intl402/Temporal/TimeZone/prototype/equals/offset-and-iana.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/equals/offset-and-iana.js b/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/equals/offset-and-iana.js
new file mode 100644
index 0000000000..af9579cf53
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/equals/offset-and-iana.js
@@ -0,0 +1,25 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2023 Justin Grant. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.timezone
+description: Offset string time zones compare as expected
+features: [Temporal]
+---*/
+
+const zdt = new Temporal.ZonedDateTime(0n, "America/Los_Angeles");
+const otz1 = new Temporal.TimeZone("+05:30");
+const otz2 = new Temporal.TimeZone("+0530");
+const tz = new Temporal.TimeZone("Asia/Kolkata");
+assert.sameValue(otz1.equals(otz2), true);
+assert.sameValue(otz2.equals(otz1), true);
+assert.sameValue(otz1.equals("+05:30"), true);
+assert.sameValue(otz1.equals(zdt.withTimeZone(otz2)), true);
+assert.sameValue(otz1.equals(zdt.withTimeZone(otz2).toString()), true);
+assert.sameValue(otz1.equals(tz), false);
+assert.sameValue(otz1.equals("Asia/Kolkata"), false);
+assert.sameValue(otz1.equals(zdt.withTimeZone(tz)), false);
+assert.sameValue(otz1.equals(zdt.withTimeZone(tz).toString()), false);
+
+reportCompare(0, 0);