summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/equals/canonical-not-equal.js
blob: f37c49054d6227f3899ea8e059bdb5d5908d2ccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// |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.from
description: Canonical time zone identifiers are never equal to each other
features: [Temporal]
---*/

// supportedValuesOf only returns canonical IDs
const ids = Intl.supportedValuesOf("timeZone");

const forEachDistinctPair = (array, func) => {
  for (let i = 0; i < array.length; i++) {
    for (let j = i + 1; j < array.length; j++) {
      func(array[i], array[j]);
    }
  }
};

forEachDistinctPair(ids, (id1, id2) => {
  const tz = new Temporal.TimeZone(id1);
  assert.sameValue(tz.equals(id2), false);
})


reportCompare(0, 0);