Skip to content

Commit

Permalink
Fix and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryQian committed Oct 31, 2018
1 parent 69bcc34 commit def0f23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ class Locale {
///
/// The format of the produced string is 'language-script_country'. Any null field
/// will result in the corresponding encoding being omitted.
@override
String toCompleteString() {
final StringBuffer out = StringBuffer(languageCode);
if (scriptCode != null)
Expand Down
5 changes: 4 additions & 1 deletion testing/dart/locale_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ void main() {

expect(const Locale.fromSubtags(languageCode: 'en').toString(), 'en');
expect(const Locale.fromSubtags(languageCode: 'en').languageCode, 'en');
expect(const Locale.fromSubtags(scriptCode: 'Latn').toString(), 'und_Latn');
expect(const Locale.fromSubtags(scriptCode: 'Latn').toString(), 'und');
expect(const Locale.fromSubtags(scriptCode: 'Latn').toCompleteString(), 'und-Latn');
expect(const Locale.fromSubtags(scriptCode: 'Latn', countryCode: 'US').toCompleteString(), 'und_US');
expect(const Locale.fromSubtags(scriptCode: 'Latn', countryCode: 'US').toCompleteString(), 'und-Latn_US');
expect(const Locale.fromSubtags(scriptCode: 'Latn').scriptCode, 'Latn');
expect(const Locale.fromSubtags(countryCode: 'US').toString(), 'und_US');
expect(const Locale.fromSubtags(countryCode: 'US').countryCode, 'US');
Expand Down

0 comments on commit def0f23

Please sign in to comment.