Update intl golden tests to match current state of the world.
PiperOrigin-RevId: 326020258
diff --git a/codereview.settings b/codereview.settings
deleted file mode 100644
index 30cd7d2..0000000
--- a/codereview.settings
+++ /dev/null
@@ -1,3 +0,0 @@
-CODE_REVIEW_SERVER: http://codereview.chromium.org/
-VIEW_VC: https://github.com/dart-lang/intl/commit/
-CC_LIST: reviews@dartlang.org
diff --git a/test/compact_number_test_data.dart b/test/compact_number_test_data.dart
index 9e73845..b862ef3 100644
--- a/test/compact_number_test_data.dart
+++ b/test/compact_number_test_data.dart
@@ -12,7 +12,8 @@
/// WARNING: These tests are NOT consistent with ICU. Compact number formatting
/// has changed, needing some more involved Dart code changes to determine
/// significant digits and decimal digits. Manual edits were made to pair up
-/// CLDR ver. 35 formats with old digit handling.
+/// CLDR ver. 35 formats with old digit handling. A small number of further
+/// manual edits were made as needed.
// MANUAL EDIT TO SUPPRESS WARNINGS IN GENERATED CODE
// ignore_for_file: prefer_single_quotes
@@ -288,7 +289,7 @@
["87654321", "৮.৮ কো", "৮.৮ কোটি"],
["987654321", "৯৯ কো", "৯৯ কোটি"],
["1087654321", "১০৯ কো", "১০৯ কোটি"],
- ["11987654321", "১১৯৯ কো", "১১৯৯ কোটি"],
+ ["11987654321", "১২শত কো", "১১৯৯ কোটি"],
["129987654321", "১২,৯৯৯ কো", "১২,৯৯৯ কোটি"],
["1398987654321", "১.৪ লা.কো.", "১.৪ লাখ কোটি"],
["14987987654321", "১৫ লা.কো.", "১৫ লাখ কোটি"],
@@ -991,9 +992,9 @@
["7654321", "7.7 M", "7.7 millones"],
["87654321", "88 M", "88 millones"],
["987654321", "988 M", "988 millones"],
- ["1087654321", "1.1k M", "1.1 mil millones"],
- ["11987654321", "12k M", "12 mil millones"],
- ["129987654321", "130k M", "130 mil millones"],
+ ["1087654321", "1088 M", "1.1 mil millones"],
+ ["11987654321", "12 mil M", "12 mil millones"],
+ ["129987654321", "130 mil M", "130 mil millones"],
["1398987654321", "1.4 B", "1.4 billón"],
["14987987654321", "15 B", "15 billones"],
["159876987654321", "160 B", "160 billones"],
@@ -1011,7 +1012,7 @@
["999444", "999 k", "999 mil"],
["9994444", "10 M", "10 millones"],
["999444444", "999 M", "999 millones"],
- ["9994444444", "10k M", "10 mil millones"],
+ ["9994444444", "9994 M", "10 mil millones"],
],
"es_ES": [
["1", "1", "1"],
@@ -3362,9 +3363,9 @@
["1087654321", "11亿", "11亿"],
["11987654321", "120亿", "120亿"],
["129987654321", "1300亿", "1300亿"],
- ["1398987654321", "1.4兆", "1.4兆"],
- ["14987987654321", "15兆", "15兆"],
- ["159876987654321", "160兆", "160兆"],
+ ["1398987654321", "1.4万亿", "1.4万亿"],
+ ["14987987654321", "15万亿", "15万亿"],
+ ["159876987654321", "160万亿", "160万亿"],
["9", "9", "9"],
["99", "99", "99"],
["999", "999", "999"],
@@ -3394,9 +3395,9 @@
["1087654321", "11亿", "11亿"],
["11987654321", "120亿", "120亿"],
["129987654321", "1300亿", "1300亿"],
- ["1398987654321", "1.4兆", "1.4兆"],
- ["14987987654321", "15兆", "15兆"],
- ["159876987654321", "160兆", "160兆"],
+ ["1398987654321", "1.4万亿", "1.4万亿"],
+ ["14987987654321", "15万亿", "15万亿"],
+ ["159876987654321", "160万亿", "160万亿"],
["9", "9", "9"],
["99", "99", "99"],
["999", "999", "999"],
diff --git a/test/data_directory.dart b/test/data_directory.dart
index 2bb9fa3..e43a8ad 100644
--- a/test/data_directory.dart
+++ b/test/data_directory.dart
@@ -11,36 +11,15 @@
/// run things by default
library data_directory;
-import 'dart:io';
+import 'package:dart.testing/google3_test_util.dart' show runfilesDir;
import 'package:path/path.dart' as path;
String get dataDirectory {
return path.join(intlDirectory, datesRelativeToIntl);
}
-/// Returns whether [dir] is the root of the `intl` package. We validate that it
-/// is by looking for a pubspec file with the entry `name: intl`.
-bool _isIntlRoot(String dir) {
- var file = File(path.join(dir, 'pubspec.yaml'));
- if (!file.existsSync()) return false;
- return file.readAsStringSync().contains('name: intl\n');
-}
-
-String get intlDirectory {
- String dir;
- if (Platform.script.scheme == 'file') {
- dir = path.fromUri(Platform.script);
- } else {
- dir = Directory.current.absolute.path;
- }
- var root = path.rootPrefix(dir);
-
- while (dir != root) {
- if (_isIntlRoot(dir)) return dir;
- dir = path.dirname(dir);
- }
- throw UnsupportedError(
- 'Cannot find the root directory of the `intl` package.');
-}
+// NOTE(tjblasi): Google3-specific code for locating the directory.
+String get intlDirectory =>
+ path.join(runfilesDir, 'google3', 'third_party', 'dart', 'intl');
String get datesRelativeToIntl => path.join('lib', 'src', 'data', 'dates');
diff --git a/test/data_directory_opensource.dart b/test/data_directory_opensource.dart
new file mode 100644
index 0000000..2bb9fa3
--- /dev/null
+++ b/test/data_directory_opensource.dart
@@ -0,0 +1,46 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// A utility function for test and tools that compensates (at least for very
+/// simple cases) for file-dependent programs being run from different
+/// directories. The important cases are
+/// - running in the directory that contains the test itself, i.e.
+/// test/ or a sub-directory.
+/// - running in root of this package, which is where the editor and bots will
+/// run things by default
+library data_directory;
+
+import 'dart:io';
+import 'package:path/path.dart' as path;
+
+String get dataDirectory {
+ return path.join(intlDirectory, datesRelativeToIntl);
+}
+
+/// Returns whether [dir] is the root of the `intl` package. We validate that it
+/// is by looking for a pubspec file with the entry `name: intl`.
+bool _isIntlRoot(String dir) {
+ var file = File(path.join(dir, 'pubspec.yaml'));
+ if (!file.existsSync()) return false;
+ return file.readAsStringSync().contains('name: intl\n');
+}
+
+String get intlDirectory {
+ String dir;
+ if (Platform.script.scheme == 'file') {
+ dir = path.fromUri(Platform.script);
+ } else {
+ dir = Directory.current.absolute.path;
+ }
+ var root = path.rootPrefix(dir);
+
+ while (dir != root) {
+ if (_isIntlRoot(dir)) return dir;
+ dir = path.dirname(dir);
+ }
+ throw UnsupportedError(
+ 'Cannot find the root directory of the `intl` package.');
+}
+
+String get datesRelativeToIntl => path.join('lib', 'src', 'data', 'dates');