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

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

Issue 12038073: Remove the code that attempts to find a locale from the command line VM in Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Switch back to having test in status file Created 7 years, 10 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/intl_standalone.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library find_default_locale_browser_test; 5 library find_default_locale_browser_test;
6 6
7 import 'package:intl/intl.dart'; 7 import 'package:intl/intl.dart';
8 import 'package:intl/intl_standalone.dart'; 8 import 'package:intl/intl_standalone.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'dart:io';
10 11
11 main() { 12 main() {
12 test("Find system locale standalone", () { 13 test("Find system locale standalone", () {
13 // TODO (alanknight): This only verifies that we found some locale. We 14 // TODO (alanknight): This only verifies that we found some locale. We
14 // should find a way to force the system locale before the test is run 15 // should find a way to force the system locale before the test is run
15 // and then verify that it's actually the correct value. 16 // and then verify that it's actually the correct value.
17 // We have no way of getting this reliably for Windows, so it will fail.
16 Intl.systemLocale = "xx_YY"; 18 Intl.systemLocale = "xx_YY";
17 var callback = expectAsync1(verifyLocale); 19 var callback = expectAsync1(verifyLocale);
18 findSystemLocale().then(callback); 20 findSystemLocale().then(callback);
19 }); 21 });
20
21 test("Test windows regex", () {
22 expect(sysInfoRegex.hasMatch("System Locale: en-US;blah blah"), isTrue);
23 expect(sysInfoRegex.hasMatch("System Locale: ru;sdfadsf"), isTrue);
24 expect(sysInfoRegex.hasMatch("System Locale: ru;"), isTrue);
25 });
26 } 22 }
27 23
28 verifyLocale(_) { 24 verifyLocale(_) {
29 expect(Intl.systemLocale, isNot(equals("xx_YY"))); 25 expect(Intl.systemLocale, isNot(equals("xx_YY")));
30 var pattern = new RegExp(r"\w\w_[A-Z0-9]+"); 26 var pattern = new RegExp(r"\w\w_[A-Z0-9]+");
31 var shortPattern = new RegExp(r"\w\w"); 27 var shortPattern = new RegExp(r"\w\w");
32 var match = pattern.hasMatch(Intl.systemLocale); 28 var match = pattern.hasMatch(Intl.systemLocale);
33 var shortMatch = shortPattern.hasMatch(Intl.systemLocale); 29 var shortMatch = shortPattern.hasMatch(Intl.systemLocale);
34 expect(match || shortMatch, isTrue); 30 expect(match || shortMatch, isTrue);
35 } 31 }
OLDNEW
« no previous file with comments | « pkg/intl/lib/intl_standalone.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698