Skip to content

Commit f4c9166

Browse files
author
Craig Cornelius
authored
Known issues in NodeJS datetime format (#520)
* Updating number format data generation and NodeJS number_fmt * Updated C++ number format, fixing errors and failing tests * Fix number format in ICU4J * Remove cout * Add halfOdd to possible test results * Add dateTimeFormatType to datagen, schema, and CPP version * Updating regex for unsupported test types. * Updates as suggested * Classify some datetime_fmt errors as known issues, fixing some ICU4C and ICU4J failures. * Handle Node known issue for timezone only format * responding to review suggestions * DateTime checking known issues * Removing schema change * Removing change in cpp file * Undoing unrelated change * Remove extra check for comma * Remove copy * Reply to suggestions * Restore check_list_differences * Fix when result is missing * Add timezone name differences to known issues * Massaging values to check KI for UTC vs GMT * Add continue statements
1 parent 001f0d4 commit f4c9166

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

verifier/check_known_issues.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class knownIssueType(Enum):
6262
datetime_semantic_Z = 'NodeJS always includes date or time'
6363

6464
datetime_GMT_UTC = 'UTC instead of GMT'
65+
datetime_TZ_name = 'Using different names of timezone'
6566

6667
# Likely Subtags
6768
likely_subtags_sr_latn = "sr_latin becoming en"
@@ -108,6 +109,7 @@ def diff_ascii_space_vs_nbsp(actual, expected_value):
108109
if not expected_value or not actual:
109110
return None
110111

112+
111113
# Normalizing all NBSP spaces to ASCII in both to check if the type of space
112114
# is the only difference in formatted output.
113115
if actual.replace(NBSP, SP) == expected_value.replace(NBSP, SP):
@@ -207,6 +209,21 @@ def dt_inserted_comma(actual, expected):
207209

208210
def dt_gmt_utc(actual, expected):
209211
# The difference may also include NBSP vs ASCII space
212+
new_expected = expected.replace(NBSP, SP).replace(',', '')
213+
new_actual = actual.replace(NBSP, SP).replace(' at', '').replace(',', '')
214+
215+
# Variant followed by standard
216+
variations = [
217+
('UTC', 'GMT'),
218+
('Coordinated Universal Time', 'Greenwich Mean Time'),
219+
('توقيت غرينتش', 'التوقيت العالمي المنسق'), # Arabic
220+
('เวลาสากลเชิงพิกัด', 'เวลามาตรฐานกรีนิช'), # Thai
221+
('協定世界時', 'グリニッジ標準時'), # Japanese
222+
]
223+
224+
for variation in variations:
225+
if new_actual.find(variation[0]) >= 0 and new_actual.replace(variation[0], variation[1]) == new_expected:
226+
return knownIssueType.datetime_GMT_UTC
210227
new_expected = expected.replace(NBSP, SP)
211228
new_actual = actual.replace(NBSP, SP)
212229

@@ -232,8 +249,10 @@ def check_datetime_known_issues(test, platform_info):
232249
input_data = test.get('input_data')
233250

234251
# Perform each test, computing matches with known issues by means of the functions in this list
235-
check_fns = [dt_gmt_utc, diff_nbsp_vs_ascii_space, diff_ascii_space_vs_nbsp, numerals_replaced_by_another_numbering_system,
236-
dt_check_arabic_comma, dt_inserted_comma, dt_check_for_alternate_long_form]
252+
check_fns = [dt_gmt_utc, diff_nbsp_vs_ascii_space, diff_ascii_space_vs_nbsp,
253+
numerals_replaced_by_another_numbering_system,
254+
dt_check_arabic_comma, dt_inserted_comma, dt_check_for_alternate_long_form]
255+
237256
for check_fn in check_fns:
238257
is_ki = check_fn(result, expected)
239258
if is_ki:

verifier/testreport.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,8 @@ def check_simple_text_diffs(self, test_list, category):
834834

835835
if isinstance(actual, bool) and isinstance(expected, bool) and actual != expected:
836836
results['boolean_diff'].add(label)
837-
837+
continue
838+
838839
if isinstance(actual, list) or isinstance(expected, list):
839840
continue
840841

0 commit comments

Comments
 (0)