Bug 1406311 - more tests for devtools l10n numbers method;r=ochameau
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 06 Oct 2017 15:18:32 +0200
changeset 386817 23317a542b406d3b77879bd94719d158407954bd
parent 386816 70ab0eb9afe2bdb59bdad402b91806b5a991033f
child 386818 d25069b1b75c5faed7387ad94bdc3130f2ae40ba
push id96311
push userarchaeopteryx@coole-files.de
push dateWed, 18 Oct 2017 09:52:02 +0000
treeherdermozilla-inbound@a8a1e8cc1980 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1406311
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1406311 - more tests for devtools l10n numbers method;r=ochameau MozReview-Commit-ID: EwJxfER0qyV
devtools/client/shared/test/browser_num-l10n.js
--- a/devtools/client/shared/test/browser_num-l10n.js
+++ b/devtools/client/shared/test/browser_num-l10n.js
@@ -17,11 +17,17 @@ function test() {
   is(l10n.numberWithDecimals(1.0001, 2), "1",
     "The third number was properly localized.");
   is(l10n.numberWithDecimals(NaN, 2), "0",
     "NaN was properly localized.");
   is(l10n.numberWithDecimals(null, 2), "0",
     "`null` was properly localized.");
   is(l10n.numberWithDecimals(undefined, 2), "0",
     "`undefined` was properly localized.");
+  is(l10n.numberWithDecimals(-1234.56789, 2), "-1,234.57",
+    "Negative number was properly localized.");
+  is(l10n.numberWithDecimals(1234.56789, 0), "1,235",
+    "Number was properly localized with decimals set 0.");
+  is(l10n.numberWithDecimals(-1234.56789, 0), "-1,235",
+    "Negative number was properly localized with decimals set 0.");
 
   finish();
 }