|
| 1 | +## WHEN UPDATING UNICODE VERSION ALSO UPDATE docs/unicode-generated-tests.asciidoc |
1 | 2 | use v6;
|
2 |
| -my IO::Path $repo-dir = $?FILE.IO.parent(2).add("3rdparty/Unicode/9.0.0/ucd/auxiliary/GraphemeBreakTest.txt"); |
| 3 | +my IO::Path $repo-dir = $?FILE.IO.parent(2).add("3rdparty/Unicode/11.0.0/ucd/auxiliary/GraphemeBreakTest.txt"); |
3 | 4 | my IO::Path $rakudo-subdir = $?FILE.IO.parent(2);
|
4 | 5 | my IO::Path $rakudo-dir = $rakudo-subdir.child($repo-dir);
|
5 | 6 | my Str:D $location = $rakudo-dir.e ?? $rakudo-dir.Str !! $repo-dir.Str;
|
@@ -45,22 +46,25 @@ values are either set to ALL or set to one or more of C,0,1,2,3,4..
|
45 | 46 | =end pod
|
46 | 47 |
|
47 | 48 | constant %fudged-tests = {
|
48 |
| - 573 => ['ALL'], |
49 |
| - 733 => ['ALL'], |
| 49 | + 694 => ['ALL'], |
| 50 | + 695 => ['ALL'], |
| 51 | + 591 => ['ALL'], |
50 | 52 | };
|
51 | 53 | constant @lines-with-normalization = (
|
52 |
| - 442 => [ 0, ], |
53 |
| - 825 => [ 0, ], |
54 |
| - 829 => [ 0, ], |
55 |
| - 837 => [ 0, ], |
| 54 | + 441 => [0, ], |
| 55 | + 674 => [ 0, ], |
| 56 | + 678 => [ 0, ], |
| 57 | + 679 => [ 0, ], |
| 58 | + 686 => [ 0, ], |
56 | 59 | );
|
57 | 60 | sub MAIN (Str:D :$file = $location, Str :$only, Bool:D :$debug = False) {
|
58 | 61 | $DEBUG = $debug;
|
| 62 | + note "WHEN UPDATING UNICODE VERSION ALSO UPDATE docs/unicode-generated-tests.asciidoc"; |
59 | 63 | my @only = $only ?? $only.split([',', ' ']) !! Empty;
|
60 | 64 | die "Can't find file at ", $file.IO.absolute unless $file.IO.f;
|
61 | 65 | note "Reading file ", $file.IO.absolute;
|
62 | 66 | my @fail;
|
63 |
| - plan (@only.elems or 2411); |
| 67 | + plan (1943); |
64 | 68 | for $file.IO.lines -> $line {
|
65 | 69 | process-line $line, @fail, :@only;
|
66 | 70 | }
|
@@ -145,7 +149,8 @@ sub process-line (Str:D $line, @fail, :@only!) {
|
145 | 149 | }
|
146 | 150 | }
|
147 | 151 | if $expected.chrs.ords.Array !eqv $expected {
|
148 |
| - die "codepoints change under normalization. manually check and add an exception or fix the script\nline no $line-no: elem $elem: ", $expected.chrs.ords.Array, ' - ', $expected; |
| 152 | + die "codepoints change under normalization. manually check and add an exception or fix the script\n" ~ " |
| 153 | + line no $line-no: elem $elem. Got: ", $expected.chrs.ords.Array.join(', '), ' from: ', $expected.join(','); |
149 | 154 | }
|
150 | 155 | }
|
151 | 156 | is-deeply $list<string>.substr($elem, 1).ords.flat.Array, $expected, "Line $line-no: grapheme [$elem] has correct codepoints" or @fail.push($line-no);
|
|
0 commit comments