diff --git a/executors/rust/1.3/src/collator.rs b/executors/rust/1.3/src/collator.rs index d054ee4d..3f4c9daa 100644 --- a/executors/rust/1.3/src/collator.rs +++ b/executors/rust/1.3/src/collator.rs @@ -28,13 +28,7 @@ pub fn run_collation_test(json_obj: &Value) -> Result { let comparison = collator.compare(str1, str2); - let result = comparison.is_le(); - - // TODO: How to do this easier? - let mut result_string = true; - if !result { - result_string = false; - } + let result_string = comparison.is_le(); let mut comparison_number: i16 = 0; if comparison == Ordering::Less { diff --git a/verifier/testreport.py b/verifier/testreport.py index d207b121..5f4c5e48 100644 --- a/verifier/testreport.py +++ b/verifier/testreport.py @@ -522,6 +522,68 @@ def characterize_failures_by_options(self, tests, result_type): 'notation', 'compactDisplay', 'style', 'currency', 'unit', 'roundingMode', ] for key in key_list: try: + locale = input_data.get('locale') + except: + locale = None + if locale: + if locale in results['locale']: + results['locale'][locale].append(label) + else: + results['locale'][locale] = [label] + + options = input_data.get('options') + if options: + # Get each combo of key/value + for key, value in options.items(): + if key not in results: + results[key] = {} + if value in results[key]: + results[key][value].append(label) + else: + results[key][value] = [label] + + # Try fields in language_names + for key in ['language_label', 'locale_label']: + try: + if input_data.get(key): + value = input_data[key] + if key not in results: + results[key] = {} + if value in results[key]: + results[key][value].append(label) + else: + results[key][value] = [label] + except: + continue + + # Try fields in likely_subtags + for key in ['option', 'locale']: + try: + if input_data.get(key): + value = input_data[key] + if key not in results: + results[key] = {} + if value in results[key]: + results[key][value].append(label) + else: + results[key][value] = [label] + except: + continue + + for key in ['language_label', 'ignorePunctuation', 'compare_result', 'compare_type', 'test_description']: + try: + if test.get(key): # For collation results + value = test[key] + if key not in results: + results[key] = {} + if value in results[key]: + results[key][value].append(label) + else: + results[key][value] = [label] + except: + continue + + for key in ['language_label', 'ignorePunctuation', 'compare_result', 'compare_type', 'test_description']: if test.get(key): # For collation results value = test[key] if key not in results: @@ -530,8 +592,6 @@ def characterize_failures_by_options(self, tests, result_type): results[key][value].append(label) else: results[key][value] = [label] - except: - continue # Look at the input_data part of the test result # TODO: Check the error_detail and error pars, too. @@ -545,21 +605,6 @@ def characterize_failures_by_options(self, tests, result_type): error_keys = error_detail.keys() # ['options'] self.add_to_results_by_key(label, results, error_detail, test, error_keys) - # if input_data: - # add_to_results_by_key(results, input_data, test, key_list) - # for key in key_list: - # try: - # if (input_data.get(key)): # For collation results - # value = test['input_data'][key] - # if key not in results: - # results[key] = {} - # if value in results[key]: - # results[key][value].append(label) - # else: - # results[key][value] = [label] - # except: - # continue - # TODO: Add substitution of [] for () # TODO: Add replacing (...) with "-" for numbers # TODO: Find the largest intersections of these sets and sort by size