Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: pkg/i18n/test/number_format_test.dart

Issue 10834318: First iteration on number formatting (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /**
2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 * for details. All rights reserved. Use of this source code is governed by a
4 * BSD-style license that can be found in the LICENSE file.
5 */
6
7 #import('../../../pkg/unittest/unittest.dart');
8 #import('../number_format.dart');
9 #import('../intl.dart');
10
11 /**
12 * Tests the Numeric formatting library in dart.
13 */
14 var testNumbers = const {
15 "0.001": 0.001,
16 "0.01": 0.01,
17 "0.1": 0.1,
18 "1": 1,
19 "2": 2.0,
20 "10": 10,
21 "100": 100,
22 "1,000": 1000,
23 "2,000,000,000,000": 2000000000000,
24 "10,000,000,000,000,000,000,000,000,000,000":
25 10000000000000000000000000000000,
26 "0.123": 0.123,
27 "1,234": 1234.0,
28 "1.234": 1.234,
29 "1.23": 1.230,
30 "NaN": 0/0,
31 "∞": 1/0,
32 "-∞": -1/0};
33
34 main() {
35 test('Basic number printing', () {
36 var number = new NumberFormat();
37 expect(number.format(3.14),"3.14");
38 });
39
40 test('Simple set of numbers', () {
41 var number = new NumberFormat();
42 for (var x in testNumbers.getKeys()) {
43 var formatted = number.format(testNumbers[x]);
44 expect(formatted, x);
45 }
46 });
47 }
OLDNEW
« pkg/i18n/number_format.dart ('K') | « pkg/i18n/number_symbols_data.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698