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

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

Issue 14544009: Fix some doc formatting problems, stop using "set" methods for NumberFormat (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
« no previous file with comments | « pkg/intl/lib/number_format.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 str = fmt.format(-1234.56); 83 str = fmt.format(-1234.56);
84 expect('-123,456.00%', str); 84 expect('-123,456.00%', str);
85 85
86 fmt = new NumberFormat.percentPattern(); 86 fmt = new NumberFormat.percentPattern();
87 str = fmt.format(-1234.579); 87 str = fmt.format(-1234.579);
88 expect('-123,458%', str); 88 expect('-123,458%', str);
89 } 89 }
90 90
91 void testCustomPercentage() { 91 void testCustomPercentage() {
92 var fmt = new NumberFormat.percentPattern(); 92 var fmt = new NumberFormat.percentPattern();
93 fmt.setMaximumFractionDigits(1); 93 fmt.maximumFractionDigits = 1;
94 fmt.setMinimumFractionDigits(1); 94 fmt.minimumFractionDigits = 1;
95 var str = fmt.format(0.1291); 95 var str = fmt.format(0.1291);
96 expect('12.9%', str); 96 expect('12.9%', str);
97 fmt.setMaximumFractionDigits(2); 97 fmt.maximumFractionDigits = 2;
98 fmt.setMinimumFractionDigits(1); 98 fmt.minimumFractionDigits = 1;
99 str = fmt.format(0.129); 99 str = fmt.format(0.129);
100 expect('12.9%', str); 100 expect('12.9%', str);
101 fmt.setMaximumFractionDigits(2); 101 fmt.maximumFractionDigits = 2;
102 fmt.setMinimumFractionDigits(1); 102 fmt.minimumFractionDigits = 1;
103 str = fmt.format(0.12); 103 str = fmt.format(0.12);
104 expect('12.0%', str); 104 expect('12.0%', str);
105 fmt.setMaximumFractionDigits(2); 105 fmt.maximumFractionDigits = 2;
106 fmt.setMinimumFractionDigits(1); 106 fmt.minimumFractionDigits = 1;
107 str = fmt.format(0.12911); 107 str = fmt.format(0.12911);
108 expect('12.91%', str); 108 expect('12.91%', str);
109 } 109 }
110 110
111 void testBasicFormat() { 111 void testBasicFormat() {
112 var fmt = new NumberFormat('0.0000'); 112 var fmt = new NumberFormat('0.0000');
113 var str = fmt.format(123.45789179565757); 113 var str = fmt.format(123.45789179565757);
114 expect('123.4579', str); 114 expect('123.4579', str);
115 } 115 }
116 116
(...skipping 262 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/lib/number_format.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698