From 7be0217d6796954694753647b7a757b8e3907f64 Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Mon, 29 Oct 2018 17:27:12 -0700 Subject: [PATCH] Roll back _countryCode assert - breaking change (#6693) * Roll back _countryCode assert - breaking change * Add tests back in --- lib/ui/window.dart | 3 +-- testing/dart/locale_test.dart | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index fff5eb4620..57b40bf1cd 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -169,8 +169,7 @@ class Locale { this._countryCode, ]) : assert(_languageCode != null), assert(_languageCode != ''), - scriptCode = null, - assert(_countryCode != ''); + scriptCode = null; /// Creates a new Locale object. /// diff --git a/testing/dart/locale_test.dart b/testing/dart/locale_test.dart index 4613a70751..66fd537a72 100644 --- a/testing/dart/locale_test.dart +++ b/testing/dart/locale_test.dart @@ -12,6 +12,8 @@ void main() { expect(const Locale('en').toString(), 'en'); expect(const Locale('en'), new Locale('en', $null)); expect(const Locale('en').hashCode, new Locale('en', $null).hashCode); + expect(const Locale('en'), isNot(new Locale('en', ''))); + expect(const Locale('en').hashCode, isNot(new Locale('en', '').hashCode)); expect(const Locale('en', 'US').toString(), 'en_US'); expect(const Locale('iw').toString(), 'he'); expect(const Locale('iw', 'DD').toString(), 'he_DE'); -- GitLab