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

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

Issue 10829442: Rename i18n to intl (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 #library('number_format_test');
8
9 #import('../../../pkg/unittest/unittest.dart');
10 #import('../number_format.dart');
11 #import('../intl.dart');
12
13 /**
14 * Tests the Numeric formatting library in dart.
15 */
16 var testNumbers = const {
17 "0.001": 0.001,
18 "0.01": 0.01,
19 "0.1": 0.1,
20 "1": 1,
21 "2": 2.0,
22 "10": 10,
23 "100": 100,
24 "1,000": 1000,
25 "2,000,000,000,000": 2000000000000,
26 "10,000,000,000,000,000,000,000,000,000,000":
27 10000000000000000000000000000000,
28 "0.123": 0.123,
29 "1,234": 1234.0,
30 "1.234": 1.234,
31 "1.23": 1.230,
32 "NaN": 0/0,
33 "∞": 1/0,
34 "-∞": -1/0};
35
36 main() {
37 test('Basic number printing', () {
38 var number = new NumberFormat();
39 expect(number.format(3.14),"3.14");
40 });
41
42 test('Simple set of numbers', () {
43 var number = new NumberFormat();
44 for (var x in testNumbers.getKeys()) {
45 var formatted = number.format(testNumbers[x]);
46 expect(formatted, x);
47 }
48 });
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698