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

Unified Diff: pkg/intl/test/intl_test.dart

Issue 10915215: Add async initialization for Intl.message and an example (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
Index: pkg/intl/test/intl_test.dart
===================================================================
--- pkg/intl/test/intl_test.dart (revision 12224)
+++ pkg/intl/test/intl_test.dart (working copy)
@@ -5,17 +5,30 @@
#library('intl_test');
#import('../intl.dart');
-#import('../../../pkg/unittest/unittest.dart');
+#import('../../unittest/unittest.dart');
#import('../date_symbol_data_local.dart');
+#import('../message_lookup_local.dart');
Emily Fortuna 2012/09/12 01:23:48 seems odd that we have to import message_lookup_lo
Alan Knight 2012/09/12 20:58:20 Good point. At one point I'd put code in there tha
main() {
- test('Set locale', (){
+ initializeMessages('en_US').then(runTheTests);
+}
+
+runTheTests(_) {
+
+ test("Locale setting doesn't verify the core locale", () {
+ var de = new Intl('de_DE');
+ expect(de.locale, equals('de_DE'));
+ });
+
+ test('DateFormat creation does verify the locale', (){
// TODO(alanknight): We need to make the locale verification be on a per
// usage basis rather than once for the entire Intl object. The set of
// locales covered for messages may be different from that for date
// formatting.
initializeDateFormatting('de_DE', null).then((_) {
var de = new Intl('de_DE');
- expect(de.locale, equals('de'));});
+ var format = de.date().add_d();
+ expect(format.locale, equals('de'));
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698