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

Side by Side Diff: pkg/intl/test/number_closure_test.dart

Issue 778293002: Make number formatting in Intl able to work with Int64 or other types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Increment version, update CHANGELOG Created 6 years 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
« no previous file with comments | « pkg/intl/test/fixnum_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // for details. All rights reserved. Use of this source code is governed by a 1 // for details. All rights reserved. Use of this source code is governed by a
2 // BSD-style license that can be found in the LICENSE file. 2 // BSD-style license that can be found in the LICENSE file.
3 3
4 /** 4 /**
5 * Tests based on the closure number formatting tests. 5 * Tests based on the closure number formatting tests.
6 */ 6 */
7 library number_closure_test; 7 library number_closure_test;
8 8
9 import "package:intl/intl.dart"; 9 import "package:intl/intl.dart";
10 import "package:unittest/unittest.dart"; 10 import "package:unittest/unittest.dart";
(...skipping 22 matching lines...) Expand all
33 return str1.length == str2.length && 33 return str1.length == str2.length &&
34 str1.substring(0, 8) == str2.substring(0, 8); 34 str1.substring(0, 8) == str2.substring(0, 8);
35 } 35 }
36 36
37 testVeryBigNumber() { 37 testVeryBigNumber() {
38 var str; 38 var str;
39 var fmt; 39 var fmt;
40 40
41 fmt = new NumberFormat.decimalPattern(); 41 fmt = new NumberFormat.decimalPattern();
42 str = fmt.format(1.3456E20); 42 str = fmt.format(1.3456E20);
43 expect(veryBigNumberCompare('134,559,999,999,999,000,000', str), isTrue); 43 expect(veryBigNumberCompare('134,560,000,000,000,000,000', str), isTrue);
44 44
45 fmt = new NumberFormat.percentPattern(); 45 fmt = new NumberFormat.percentPattern();
46 str = fmt.format(1.3456E20); 46 str = fmt.format(1.3456E20);
47 expect(veryBigNumberCompare('13,456,000,000,000,000,000,000%', str), isTrue); 47 expect(veryBigNumberCompare('13,456,000,000,000,000,000,000%', str), isTrue);
48 48
49 // TODO(alanknight): Note that this disagrees with what ICU would print 49 // TODO(alanknight): Note that this disagrees with what ICU would print
50 // for this. We need significant digit support to do this properly. 50 // for this. We need significant digit support to do this properly.
51 fmt = new NumberFormat.scientificPattern(); 51 fmt = new NumberFormat.scientificPattern();
52 str = fmt.format(1.3456E20); 52 str = fmt.format(1.3456E20);
53 expect('1E20', str); 53 expect('1E20', str);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 379
380 testLocaleSwitch() { 380 testLocaleSwitch() {
381 Intl.withLocale("fr", verifyFrenchLocale); 381 Intl.withLocale("fr", verifyFrenchLocale);
382 } 382 }
383 383
384 void verifyFrenchLocale() { 384 void verifyFrenchLocale() {
385 var fmt = new NumberFormat('#,###'); 385 var fmt = new NumberFormat('#,###');
386 var str = fmt.format(1234567890); 386 var str = fmt.format(1234567890);
387 expect('1\u00a0234\u00a0567\u00a0890', str); 387 expect('1\u00a0234\u00a0567\u00a0890', str);
388 } 388 }
OLDNEW
« no previous file with comments | « pkg/intl/test/fixnum_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698