aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/intl402/ch12/12.3/12.3.2_3.js
blob: 21fc256fe0860a62d441db0f01dfed18029888fa (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
// Copyright 2012 Google Inc.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @path intl402/ch12/12.3/12.3.2_3.js
 * @description Tests that Intl.NumberFormat.prototype.format
 * doesn't treat all numbers as negative.
 * @author: Roozbeh Pournader
 */

var testcase = function() {
  "use strict";

  var formatter = new Intl.NumberFormat();
  
  if (formatter.format(1) === formatter.format(-1)) {
    $ERROR('Intl.NumberFormat is formatting 1 and -1 the same way.');
  }

  if (formatter.format(-0) !== formatter.format(0)) {
    $ERROR('Intl.NumberFormat is formatting signed zeros differently.');
  }

  return true;
}
runTestCase(testcase);