Revamp t/uni/fold.t
authorKarl Williamson <public@khwilliamson.com>
Wed, 15 Dec 2010 16:57:25 +0000 (09:57 -0700)
committerKarl Williamson <public@khwilliamson.com>
Wed, 15 Dec 2010 23:24:37 +0000 (16:24 -0700)
commitdaf3b8d4938645bc97bae0c97b089ea40463c913
tree156d6a020a33eaa288dbbd22304a96e422fc0e64
parenta42d02426c51c2ef1bdefac84284a828de703cda
Revamp t/uni/fold.t

This patch revamps fold.t but using essentially the same tests on
essentially the same character set.  It:
    1) Works on EBCDIC
    2) Uses test.pl
    3) Separates out the 8 tests per character that previously were all
        combined into a single test per character
    4) Outputs on each line the actual test performed
    5) Corrects and hardens some tests on multi-character folding
        characters.

To expand on point 5):  Previously, the wrong behavior was tested for;
correct behavior failed.  For example,
    ":\N{LATIN SMALL LIGATURE ST}:" =~ /:[_st]:/i
previously passed.  But the fold of the string is two characters, and so
should not match a one-character long character class.  Instead it
should match:
    ":\N{LATIN SMALL LIGATURE ST}:" =~ /:[_st]{2}:/i
The new test includes TODO tests for both of them.
    ":\N{LATIN SMALL LIGATURE ST}:" !~ /:[_st]:/i
    ":\N{LATIN SMALL LIGATURE ST}:" =~ /:[_st]{2}:/i

Also the inverse relation
    ":st:" =~ /:[_\N{LATIN SMALL LIGATURE ST}]:/i
passes, semi-coincidentally, for some.  By changing the test to
    ":ST:" =~ /:[_\N{LATIN SMALL LIGATURE ST}]:/i
they all fail, (and are made TODO's).
t/uni/fold.t