Skip to content

Commit

Permalink
Advanced collation - fixes many NodeJS collation failures (#124)
Browse files Browse the repository at this point in the history
* Resolve diff in node version

* Adding ICU74 test data and collationtest.txt for older versions

* Fix error in collation parameters. fix rust formatting.

* Fix collation call in Node - removes 85% of test failures
  • Loading branch information
sven-oly authored Nov 18, 2023
1 parent d13b91c commit 34f5f0c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion executors/node/collator.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
let testCollOptions = {};
if ('ignorePunctuation' in json) {
testCollOptions = {
ignorePunctuation:json['ignorePunction']}
ignorePunctuation:json['ignorePunctuation']}
}

// Get other fields if provided
Expand Down
3 changes: 3 additions & 0 deletions testgen/testdata_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,9 @@ def generateCollTestData2(filename,
compare_type = is_comparison.group(1)
compare_string = is_comparison.group(2)
# Note that this doesn't seem to handle \x encoding, howeveer.
string2 = compare_string.encode().decode('unicode_escape')
compare_comment = is_comparison.group(3)
# Generate the test case
try:
s = compare_string.encode()
string2 = s.decode('unicode_escape')
Expand Down
9 changes: 9 additions & 0 deletions verifier/testreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,15 @@ def characterize_failures_by_options(self, failing_tests):
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:
results[key] = {}
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
for key in ['ignorePunctuation']:
try:
if (test.get('input_data') and test['input_data'].get(key)): # For collation results
Expand Down

0 comments on commit 34f5f0c

Please sign in to comment.