This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fold_grind.t: Add tests
authorKarl Williamson <public@khwilliamson.com>
Sat, 18 May 2013 19:09:05 +0000 (13:09 -0600)
committerKarl Williamson <public@khwilliamson.com>
Mon, 20 May 2013 17:01:53 +0000 (11:01 -0600)
commita3f3bf18711ca1acde9e5a41d4c7b1f3adc4afd1
tree86c0c95576cc4f1398cc96d8a98f4daf6e524477
parent1ca267a56acf698557ec1deec44af651acc88696
fold_grind.t: Add tests

fold-grind stresses the /i regex handling by reading the Unicode folding
rules and creating tests for problematic cases, as well as some
non-problematic ones.

Because of the large number of tests generated, it otherwise avoids
tests that it doesn't think are problematic.

Problematic cases include those whose folds cross the ordinal 127/128 or
255/256 boundaries, along with other considerations.

Until this commit, fold_grind failed to realize that even if the pair of
characters currently being tested don't cross those boundaries, if their
eventual folds do, this could be problematic.  Suppose X and Y are both
on the same side of the boundaries, and both fold to Z which is on
another side.  Then X and Y should be equivalent under /i even if the
fold to Z is prohibited because of /aa or /l.  fold_grind was
overzealous in pruning such tests.

The previous patch fixed bugs in handling such cases; and this patch
fixes the tests to look for similar things that might possibly arise in
the future.

Interestingly, this bug came to light during porting to an EBCDIC
platform.  The reason is that because of the different collation order,
fold_grind chose one of the buggy cases to test as one its
non-problematic tests.
t/re/fold_grind.t