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

Unified Diff: test/number_closure_test.dart

Issue 832073002: Make withLocale use a zone (Closed) Base URL: https://github.com/dart-lang/intl.git@master
Patch Set: Update CHANGELOG and pubspec to bump version Created 5 years, 12 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 side-by-side diff with in-line comments
Download patch
« lib/intl.dart ('K') | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/number_closure_test.dart
diff --git a/test/number_closure_test.dart b/test/number_closure_test.dart
index d715d7e2114b2fe81997a3d91d3bfc9ec0073477..1355e459b791acb6bb431da2d5e285567df1974b 100644
--- a/test/number_closure_test.dart
+++ b/test/number_closure_test.dart
@@ -6,6 +6,7 @@
*/
library number_closure_test;
+import 'dart:async';
import "package:intl/intl.dart";
import "package:unittest/unittest.dart";
@@ -23,6 +24,7 @@ main() {
test("testPlusSignInExponentPart", testPlusSignInExponentPart);
test("testApis", testApis);
test("testLocaleSwitch", testLocaleSwitch);
+ test("testLocaleSwitchAsync", testLocaleSwitchAsync);
}
/**
@@ -381,8 +383,16 @@ testLocaleSwitch() {
Intl.withLocale("fr", verifyFrenchLocale);
}
+testLocaleSwitchAsync() {
+ Intl.withLocale("fr", () {
+ new Timer(new Duration(milliseconds:10), expectAsync(verifyFrenchLocale));
+ });
+ // Verify that things running outside the zone still get en_US.
+ testStandardFormat();
+}
+
void verifyFrenchLocale() {
var fmt = new NumberFormat('#,###');
var str = fmt.format(1234567890);
- expect('1\u00a0234\u00a0567\u00a0890', str);
+ expect(str, '1\u00a0234\u00a0567\u00a0890');
}
« lib/intl.dart ('K') | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698