| OLD | NEW |
| 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 | 5 |
| 6 #library('intl_message_test'); | 6 #library('intl_message_test'); |
| 7 | 7 |
| 8 #import('../../../lib/i18n/intl.dart'); | 8 #import('../../../lib/i18n/intl.dart'); |
| 9 #import('../../../lib/i18n/intl_message.dart'); |
| 9 #import('../../../lib/unittest/unittest.dart'); | 10 #import('../../../lib/unittest/unittest.dart'); |
| 10 | 11 |
| 11 /** Tests the MessageFormat library in dart. */ | 12 /** |
| 13 * Tests the MessageFormat library in dart. |
| 14 */ |
| 12 | 15 |
| 13 class Person { | 16 class Person { |
| 14 String firstName, lastName; | 17 String firstName, lastName; |
| 15 Person(this.firstName, this.lastName); | 18 Person(this.firstName, this.lastName); |
| 16 } | 19 } |
| 17 | 20 |
| 18 main() { | 21 main() { |
| 19 test('Trivial Message', () { | 22 test('Trivial Message', () { |
| 20 hello() => Intl.message('Hello, world!', | 23 hello() => Intl.message('Hello, world!', |
| 21 desc: 'hello world string'); | 24 desc: 'hello world string'); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 desc: 'explains the locale'); | 80 desc: 'explains the locale'); |
| 78 expect(Intl.withLocale('en-US', () => hello()), equals('locale=en-US')); | 81 expect(Intl.withLocale('en-US', () => hello()), equals('locale=en-US')); |
| 79 }); | 82 }); |
| 80 | 83 |
| 81 test('Test passing locale', () { | 84 test('Test passing locale', () { |
| 82 hello(a_locale) => Intl.message('locale=${Intl.getCurrentLocale()}', | 85 hello(a_locale) => Intl.message('locale=${Intl.getCurrentLocale()}', |
| 83 desc: 'explains the locale', locale: a_locale); | 86 desc: 'explains the locale', locale: a_locale); |
| 84 expect(hello('en-US'), equals('locale=en-US')); | 87 expect(hello('en-US'), equals('locale=en-US')); |
| 85 }); | 88 }); |
| 86 } | 89 } |
| OLD | NEW |