Chromium Code Reviews| Index: pkg/intl/test/message_extraction/message_extraction_test.dart |
| diff --git a/pkg/intl/test/message_extraction/message_extraction_test.dart b/pkg/intl/test/message_extraction/message_extraction_test.dart |
| index 92aa3e652b2561b76b2c0a1180942ab77307582c..6c7fea0c579290ac663487c2d3743cbe1956bac6 100644 |
| --- a/pkg/intl/test/message_extraction/message_extraction_test.dart |
| +++ b/pkg/intl/test/message_extraction/message_extraction_test.dart |
| @@ -48,8 +48,13 @@ final vmArgs = (packageDir == null) ? [] : ['--package-root=$packageDir']; |
| * Translate a file path into this test directory, regardless of the |
| * working directory. |
| */ |
| -String dir([String s]) => |
| - path.join(intlDirectory, 'test', 'message_extraction', s); |
| +String dir([String s]) { |
| + if (s != null && s.startsWith("--")) { // Don't touch command-line options. |
|
Emily Fortuna
2013/04/23 17:24:48
indentation is off on this method (2 spaces)
Alan Knight
2013/04/23 17:59:56
Done.
|
| + return s; |
| + } else { |
| + return path.join(intlDirectory(), 'test', 'message_extraction', s); |
| + } |
| +} |
| main() { |
| test("Test round trip message extraction, translation, code generation, " |
| @@ -68,8 +73,8 @@ main() { |
| void deleteGeneratedFiles() { |
| var files = [dir('intl_messages.json'), dir('translation_fr.json'), |
| - dir('messages_fr.dart'), dir('messages_de_DE.dart'), |
| - dir('translation_de_DE.json'), dir('messages_all.dart')]; |
| + dir('foo_messages_fr.dart'), dir('foo_messages_de_DE.dart'), |
| + dir('translation_de_DE.json'), dir('foo_messages_all.dart')]; |
| files.map((name) => new File(name)).forEach((x) { |
| if (x.existsSync()) x.deleteSync();}); |
| } |
| @@ -107,7 +112,7 @@ Future<ProcessResult> run(ProcessResult previousResult, List<String> filenames) |
| Future<ProcessResult> extractMessages(ProcessResult previousResult) => run( |
| previousResult, |
| - ['extract_to_json.dart', 'sample_with_messages.dart', |
| + ['extract_to_json.dart', '--suppress-warnings', 'sample_with_messages.dart', |
| 'part_of_sample_with_messages.dart']); |
| Future<ProcessResult> generateTranslationFiles(ProcessResult previousResult) => |
| @@ -118,7 +123,8 @@ Future<ProcessResult> generateTranslationFiles(ProcessResult previousResult) => |
| Future<ProcessResult> generateCodeFromTranslation(ProcessResult previousResult) |
| => run( |
| previousResult, |
| - ['generate_from_json.dart', 'sample_with_messages.dart', |
| + ['generate_from_json.dart', '--generated-file-prefix=foo_', |
| + 'sample_with_messages.dart', |
| 'part_of_sample_with_messages.dart', 'translation_fr.json', |
| 'translation_de_DE.json' ]); |
| @@ -135,9 +141,8 @@ verifyResult(results) { |
| var output = results.stdout; |
| var lines = output.split("\n"); |
| - // If it looks like these are CRLF delimited, then use that. Wish strings |
| - // just implemented last. |
| - if (lines.first.codeUnits.last == "\r".codeUnits.first) { |
| + // If it looks like these are CRLF delimited, then use that. |
| + if (lines.first.endsWith("\r")) { |
| lines = output.split("\r\n"); |
| } |
| lineIterator = lines.iterator..moveNext(); |