Skip to content

Commit 00f2d15

Browse files
committed
Classify test results in dispute
1 parent 60ea28e commit 00f2d15

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

lib/cldr/locale_display.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ defmodule Cldr.LocaleDisplay do
122122

123123
case first_match(language_tag, match_fun, @omit_script_if_only_one, language_display, prefer) do
124124
{language_name, matched_tags} ->
125-
language_name = replace_parens_with_brackets(language_name)
126125
language_tag = merge_extensions_and_private_use(language_tag)
127126

128127
subtag_names =
@@ -263,6 +262,7 @@ defmodule Cldr.LocaleDisplay do
263262
end
264263

265264
defp format_display_name(language_name, subtag_names, extension_names, display_names) do
265+
language_name = replace_parens_with_brackets(language_name)
266266
locale_pattern = get_in(display_names, [:locale_display_pattern, :locale_pattern])
267267

268268
subtags =

test/locale_display_name_test.exs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,25 @@ defmodule Cldr.LocaleDisplayName.Test do
66

77
# These tests have issues:
88
# * 1566, 1569, 1686, 1699 seem to have the icorrect test result in the data
9-
# * 330 and 331 appear to have the wrong timezone returned
9+
# * 344, 345 appear to have the wrong timezone returned
1010
# * 21,41 includes a field for a -u- tag that is invalid
11+
@invalid_test_results [21, 41, 344, 345, 1556, 1569, 1686, 1699]
1112

12-
@except_lines [21, 41, 1556, 1569, 1686, 1699]
13+
# These have test results with [] but I think they should remain ()
14+
# since there are no subtags or extensions.
15+
@results_should_be_parens [
16+
396, 474, 500, 786, 864, 942, 1124, 1203, 1254, 1358, 1384, 1538, 1928, 2008,
17+
2188, 2214, 2242, 2254, 2268, 2294, 2500, 2554, 2580, 2684, 2708, 2942, 2968,
18+
2994, 3020, 3022, 3126, 3152, 3178
19+
]
20+
21+
# The test results for these are what would be generated with
22+
# language_display: :standard, but the test specifies language_tag: :dialect
23+
@wrong_language_display [
24+
2370, 2374, 2375, 2371
25+
]
26+
27+
@except_lines @invalid_test_results ++ @results_should_be_parens ++ @wrong_language_display
1328
@locales [:en, :fr, :de, :it, :es, :zh, :"zh-Hans", :"zh-Hant", :ja]
1429

1530
for [line, locale, language_display, from, to] <- Cldr.LocaleDisplayNameGenerator.data(), line not in @except_lines do

0 commit comments

Comments
 (0)