Skip to content

Commit 34f5f0c

Browse files
authored
Advanced collation - fixes many NodeJS collation failures (#124)
* 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
1 parent d13b91c commit 34f5f0c

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

executors/node/collator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
let testCollOptions = {};
1515
if ('ignorePunctuation' in json) {
1616
testCollOptions = {
17-
ignorePunctuation:json['ignorePunction']}
17+
ignorePunctuation:json['ignorePunctuation']}
1818
}
1919

2020
// Get other fields if provided

testgen/testdata_gen.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@ def generateCollTestData2(filename,
734734
compare_type = is_comparison.group(1)
735735
compare_string = is_comparison.group(2)
736736
# Note that this doesn't seem to handle \x encoding, howeveer.
737+
string2 = compare_string.encode().decode('unicode_escape')
738+
compare_comment = is_comparison.group(3)
739+
# Generate the test case
737740
try:
738741
s = compare_string.encode()
739742
string2 = s.decode('unicode_escape')

verifier/testreport.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,15 @@ def characterize_failures_by_options(self, failing_tests):
577577
except:
578578
continue
579579

580+
for key in ['language_label', 'ignorePunctuation', 'compare_result', 'compare_type', 'test_description']:
581+
if test.get(key): # For collation results
582+
value = test[key]
583+
if key not in results:
584+
results[key] = {}
585+
if value in results[key]:
586+
results[key][value].append(label)
587+
else:
588+
results[key][value] = [label]
580589
for key in ['ignorePunctuation']:
581590
try:
582591
if (test.get('input_data') and test['input_data'].get(key)): # For collation results

0 commit comments

Comments
 (0)