From 2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:50 +0200 Subject: Merging upstream version 1.69.0+dfsg1. Signed-off-by: Daniel Baumann --- .../tests/fixtures/invalid-extensions.json | 40 ++++++++++++++++++ vendor/icu_locid/tests/fixtures/invalid.json | 49 ++++++++++++++++++++++ vendor/icu_locid/tests/fixtures/mod.rs | 1 + 3 files changed, 90 insertions(+) (limited to 'vendor/icu_locid/tests/fixtures') diff --git a/vendor/icu_locid/tests/fixtures/invalid-extensions.json b/vendor/icu_locid/tests/fixtures/invalid-extensions.json index a5f3a923d..3aff2636b 100644 --- a/vendor/icu_locid/tests/fixtures/invalid-extensions.json +++ b/vendor/icu_locid/tests/fixtures/invalid-extensions.json @@ -108,5 +108,45 @@ "error": "InvalidExtension", "text": "Invalid subtag" } + }, + { + "input": { + "type": "Locale", + "identifier": "de-u-ca-" + }, + "output": { + "error": "InvalidExtension", + "text": "Invalid subtag" + } + }, + { + "input": { + "type": "Locale", + "identifier": "de-u-ca-gregory-" + }, + "output": { + "error": "InvalidExtension", + "text": "Invalid subtag" + } + }, + { + "input": { + "type": "Locale", + "identifier": "de-u-ca-gregory-u-hc-hc24" + }, + "output": { + "error": "DuplicatedExtension", + "text": "Duplicated extension" + } + }, + { + "input": { + "type": "Locale", + "identifier": "de-l-foo-l-bar" + }, + "output": { + "error": "DuplicatedExtension", + "text": "Duplicated extension" + } } ] diff --git a/vendor/icu_locid/tests/fixtures/invalid.json b/vendor/icu_locid/tests/fixtures/invalid.json index d44007596..c22459e65 100644 --- a/vendor/icu_locid/tests/fixtures/invalid.json +++ b/vendor/icu_locid/tests/fixtures/invalid.json @@ -1,4 +1,53 @@ [ + { + "input": "-", + "output": { + "error": "InvalidLanguage", + "text": "The given language subtag is invalid" + } + }, + { + "input": "--", + "output": { + "error": "InvalidLanguage", + "text": "The given subtag is invalid" + } + }, + { + "input": "en-", + "output": { + "error": "InvalidSubtag", + "text": "The given subtag is invalid" + } + }, + { + "input": "-en", + "output": { + "error": "InvalidLanguage", + "text": "The given subtag is invalid" + } + }, + { + "input": "en-us-", + "output": { + "error": "InvalidSubtag", + "text": "The given subtag is invalid" + } + }, + { + "input": "en--US", + "output": { + "error": "InvalidSubtag", + "text": "The given subtag is invalid" + } + }, + { + "input": "-e-", + "output": { + "error": "InvalidLanguage", + "text": "The given subtag is invalid" + } + }, { "input": "a1a", "output": { diff --git a/vendor/icu_locid/tests/fixtures/mod.rs b/vendor/icu_locid/tests/fixtures/mod.rs index b688632ba..f00fd6c3b 100644 --- a/vendor/icu_locid/tests/fixtures/mod.rs +++ b/vendor/icu_locid/tests/fixtures/mod.rs @@ -248,6 +248,7 @@ impl From for ParserError { "InvalidLanguage" => ParserError::InvalidLanguage, "InvalidSubtag" => ParserError::InvalidSubtag, "InvalidExtension" => ParserError::InvalidExtension, + "DuplicatedExtension" => ParserError::DuplicatedExtension, _ => unreachable!("Unknown error name"), } } -- cgit v1.2.3