Skip to content

Commit

Permalink
Characterize plural_rules results by type of sample
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-oly committed Nov 14, 2024
1 parent 91c85c5 commit 18e3608
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions verifier/testreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,12 @@ def characterize_results_by_options(self, test_list, category):
# User self.failing_tests, looking at options
results = defaultdict(lambda : defaultdict(list))
results['locale'] = {} # Dictionary of labels for each locale

# Look at particular test types
if test_list:
if self.test_type == 'plural_rules':
self.characterize_plural_rules_tests(test_list, results)

for test in test_list:
# Get input_data, if available
input_data = test.get('input_data', None)
Expand Down Expand Up @@ -699,6 +705,25 @@ def characterize_results_by_options(self, test_list, category):

return results


def characterize_plural_rules_tests(self, test_list, results):
# look for consistencies with plural rules test
for test in test_list:
label = test['label']
sample = test['input_data']['sample']
sample_type = 'integer sample'
if sample.find('c') >= 0:
sample_type = 'compact sample'
elif sample.find('.') >= 0:
sample_type = 'float sample'
elif sample.find('.e') >= 0:
sample_type = 'exponential sample'
if sample_type in results:
results[sample_type].append(label)
else:
results[sample_type] = [label]
return

# TODO: Use the following function to update lists.
def add_to_results_by_key(self, label, results, input_data, test, key_list):
if input_data:
Expand Down

0 comments on commit 18e3608

Please sign in to comment.