summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Set/prototype/symmetricDifference/result-order.js
blob: b94f1f37ba9c003427599ffb2c207874f3389632 (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
// |reftest| skip -- set-methods is not supported
// Copyright (C) 2023 Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-set.prototype.symmetricdifference
description: Set.prototype.symmetricDifference result ordering
features: [set-methods]
includes: [compareArray.js]
---*/

// results are ordered as in this, then as in other
{
  const s1 = new Set([1, 2, 3, 4]);
  const s2 = new Set([6, 5, 4, 3]);

  assert.compareArray([...s1.symmetricDifference(s2)], [1, 2, 6, 5]);
}

{
  const s1 = new Set([6, 5, 4, 3]);
  const s2 = new Set([1, 2, 3, 4]);

  assert.compareArray([...s1.symmetricDifference(s2)], [6, 5, 1, 2]);
}

reportCompare(0, 0);