summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Intl/NumberFormat/numberingSystem-format.js
blob: c0b9ba78edd12523ae9b3122bc7043bc033ab9c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
for (let [numberingSystem, {digits, algorithmic}] of Object.entries(numberingSystems)) {
  if (algorithmic) {
    // We don't yet support algorithmic numbering systems.
    continue;
  }

  let nf = new Intl.NumberFormat("en", {numberingSystem});

  assertEq([...digits].length, 10, "expect exactly ten digits for each numbering system");

  let i = 0;
  for (let digit of digits) {
    assertEq(nf.format(i++), digit);
  }
}

if (typeof reportCompare === "function")
  reportCompare(true, true);