diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-07-08 11:40:55 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-07-08 16:21:04 -0600 |
commit | c9c0535823bbd207e509723201c3b1ea752cc280 (patch) | |
tree | d649e1b59e469c7ea11ea3c23e2b611091d90c2b /ext | |
parent | bce3d7a428b0a811f0327402e049fd428886eaae (diff) | |
download | perl-c9c0535823bbd207e509723201c3b1ea752cc280.tar.gz |
handy.: Add some tests for its API
Diffstat (limited to 'ext')
-rw-r--r-- | ext/XS-APItest/APItest.xs | 431 | ||||
-rw-r--r-- | ext/XS-APItest/t/handy.t | 372 |
2 files changed, 801 insertions, 2 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index 3785c3b059..168594844d 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -3512,8 +3512,435 @@ test_isBLANK_uni(UV ord) RETVAL bool -test_isBLANK_utf8(char * p) +test_isBLANK_A(UV ord) CODE: - RETVAL = isBLANK_utf8((U8 *) p); + RETVAL = isBLANK_A(ord); + OUTPUT: + RETVAL + +bool +test_isBLANK_L1(UV ord) + CODE: + RETVAL = isBLANK_L1(ord); + OUTPUT: + RETVAL + +bool +test_isBLANK_utf8(unsigned char * p) + CODE: + RETVAL = isBLANK_utf8(p); + OUTPUT: + RETVAL + +bool +test_isUPPER_uni(UV ord) + CODE: + RETVAL = isUPPER_uni(ord); + OUTPUT: + RETVAL + +bool +test_isUPPER_A(UV ord) + CODE: + RETVAL = isUPPER_A(ord); + OUTPUT: + RETVAL + +bool +test_isUPPER_L1(UV ord) + CODE: + RETVAL = isUPPER_L1(ord); + OUTPUT: + RETVAL + +bool +test_isUPPER_utf8(unsigned char * p) + CODE: + RETVAL = isUPPER_utf8( p); + OUTPUT: + RETVAL + +bool +test_isLOWER_uni(UV ord) + CODE: + RETVAL = isLOWER_uni(ord); + OUTPUT: + RETVAL + +bool +test_isLOWER_A(UV ord) + CODE: + RETVAL = isLOWER_A(ord); + OUTPUT: + RETVAL + +bool +test_isLOWER_L1(UV ord) + CODE: + RETVAL = isLOWER_L1(ord); + OUTPUT: + RETVAL + +bool +test_isLOWER_utf8(unsigned char * p) + CODE: + RETVAL = isLOWER_utf8( p); + OUTPUT: + RETVAL + +bool +test_isALPHA_uni(UV ord) + CODE: + RETVAL = isALPHA_uni(ord); + OUTPUT: + RETVAL + +bool +test_isALPHA_A(UV ord) + CODE: + RETVAL = isALPHA_A(ord); + OUTPUT: + RETVAL + +bool +test_isALPHA_L1(UV ord) + CODE: + RETVAL = isALPHA_L1(ord); + OUTPUT: + RETVAL + +bool +test_isALPHA_utf8(unsigned char * p) + CODE: + RETVAL = isALPHA_utf8( p); + OUTPUT: + RETVAL + +bool +test_isALNUM_uni(UV ord) + CODE: + RETVAL = isALNUM_uni(ord); + OUTPUT: + RETVAL + +bool +test_isALNUM_A(UV ord) + CODE: + RETVAL = isWORDCHAR_A(ord); + OUTPUT: + RETVAL + +bool +test_isALNUM_L1(UV ord) + CODE: + RETVAL = isWORDCHAR_L1(ord); + OUTPUT: + RETVAL + +bool +test_isALNUM_utf8(unsigned char * p) + CODE: + RETVAL = isALNUM_utf8( p); + OUTPUT: + RETVAL + +bool +test_isDIGIT_uni(UV ord) + CODE: + RETVAL = isDIGIT_uni(ord); + OUTPUT: + RETVAL + +bool +test_isDIGIT_utf8(unsigned char * p) + CODE: + RETVAL = isDIGIT_utf8( p); + OUTPUT: + RETVAL + +bool +test_isDIGIT_A(UV ord) + CODE: + RETVAL = isDIGIT_A(ord); + OUTPUT: + RETVAL + +bool +test_isDIGIT_L1(UV ord) + CODE: + RETVAL = isDIGIT_L1(ord); + OUTPUT: + RETVAL + +bool +test_isIDFIRST_uni(UV ord) + CODE: + RETVAL = isIDFIRST_uni(ord); + OUTPUT: + RETVAL + +bool +test_isIDFIRST_A(UV ord) + CODE: + RETVAL = isIDFIRST_A(ord); + OUTPUT: + RETVAL + +bool +test_isIDFIRST_L1(UV ord) + CODE: + RETVAL = isIDFIRST_L1(ord); + OUTPUT: + RETVAL + +bool +test_isIDFIRST_utf8(unsigned char * p) + CODE: + RETVAL = isIDFIRST_utf8( p); + OUTPUT: + RETVAL + +bool +test_isSPACE_uni(UV ord) + CODE: + RETVAL = isSPACE_uni(ord); + OUTPUT: + RETVAL + +bool +test_isSPACE_A(UV ord) + CODE: + RETVAL = isSPACE_A(ord); + OUTPUT: + RETVAL + +bool +test_isSPACE_L1(UV ord) + CODE: + RETVAL = isSPACE_L1(ord); + OUTPUT: + RETVAL + +bool +test_isSPACE_utf8(unsigned char * p) + CODE: + RETVAL = isSPACE_utf8( p); + OUTPUT: + RETVAL + +bool +test_isASCII_uni(UV ord) + CODE: + RETVAL = isASCII_uni(ord); + OUTPUT: + RETVAL + +bool +test_isASCII_A(UV ord) + CODE: + RETVAL = isASCII_A(ord); + OUTPUT: + RETVAL + +bool +test_isASCII_L1(UV ord) + CODE: + RETVAL = isASCII_L1(ord); + OUTPUT: + RETVAL + +bool +test_isASCII_utf8(unsigned char * p) + CODE: + RETVAL = isASCII_utf8( p); + OUTPUT: + RETVAL + +bool +test_isCNTRL_uni(UV ord) + CODE: + RETVAL = isCNTRL_uni(ord); + OUTPUT: + RETVAL + +bool +test_isCNTRL_A(UV ord) + CODE: + RETVAL = isCNTRL_A(ord); + OUTPUT: + RETVAL + +bool +test_isCNTRL_L1(UV ord) + CODE: + RETVAL = isCNTRL_L1(ord); + OUTPUT: + RETVAL + +bool +test_isCNTRL_utf8(unsigned char * p) + CODE: + RETVAL = isCNTRL_utf8( p); + OUTPUT: + RETVAL + +bool +test_isPRINT_uni(UV ord) + CODE: + RETVAL = isPRINT_uni(ord); + OUTPUT: + RETVAL + +bool +test_isPRINT_A(UV ord) + CODE: + RETVAL = isPRINT_A(ord); + OUTPUT: + RETVAL + +bool +test_isPRINT_L1(UV ord) + CODE: + RETVAL = isPRINT_L1(ord); + OUTPUT: + RETVAL + +bool +test_isPRINT_utf8(unsigned char * p) + CODE: + RETVAL = isPRINT_utf8( p); + OUTPUT: + RETVAL + +bool +test_isGRAPH_uni(UV ord) + CODE: + RETVAL = isGRAPH_uni(ord); + OUTPUT: + RETVAL + +bool +test_isGRAPH_A(UV ord) + CODE: + RETVAL = isGRAPH_A(ord); + OUTPUT: + RETVAL + +bool +test_isGRAPH_L1(UV ord) + CODE: + RETVAL = isGRAPH_L1(ord); + OUTPUT: + RETVAL + +bool +test_isGRAPH_utf8(unsigned char * p) + CODE: + RETVAL = isGRAPH_utf8( p); + OUTPUT: + RETVAL + +bool +test_isALNUMC_A(UV ord) + CODE: + RETVAL = isALNUMC_A(ord); + OUTPUT: + RETVAL + +bool +test_isALNUMC_L1(UV ord) + CODE: + RETVAL = isALNUMC_L1(ord); + OUTPUT: + RETVAL + +bool +test_isPUNCT_uni(UV ord) + CODE: + RETVAL = isPUNCT_uni(ord); + OUTPUT: + RETVAL + +bool +test_isPUNCT_A(UV ord) + CODE: + RETVAL = isPUNCT_A(ord); + OUTPUT: + RETVAL + +bool +test_isPUNCT_L1(UV ord) + CODE: + RETVAL = isPUNCT_L1(ord); + OUTPUT: + RETVAL + +bool +test_isPUNCT_utf8(unsigned char * p) + CODE: + RETVAL = isPUNCT_utf8( p); + OUTPUT: + RETVAL + +bool +test_isXDIGIT_uni(UV ord) + CODE: + RETVAL = isXDIGIT_uni(ord); + OUTPUT: + RETVAL + +bool +test_isXDIGIT_A(UV ord) + CODE: + RETVAL = isXDIGIT_A(ord); + OUTPUT: + RETVAL + +bool +test_isXDIGIT_L1(UV ord) + CODE: + RETVAL = isXDIGIT_L1(ord); + OUTPUT: + RETVAL + +bool +test_isXDIGIT_utf8(unsigned char * p) + CODE: + RETVAL = isXDIGIT_utf8( p); + OUTPUT: + RETVAL + +bool +test_isPSXSPC_uni(UV ord) + CODE: + RETVAL = isPSXSPC_uni(ord); + OUTPUT: + RETVAL + +bool +test_isPSXSPC_A(UV ord) + CODE: + RETVAL = isPSXSPC_A(ord); + OUTPUT: + RETVAL + +bool +test_isPSXSPC_L1(UV ord) + CODE: + RETVAL = isPSXSPC_L1(ord); + OUTPUT: + RETVAL + +bool +test_isPSXSPC_utf8(unsigned char * p) + CODE: + RETVAL = isPSXSPC_utf8( p); + OUTPUT: + RETVAL + +bool +test_isQUOTEMETA(UV ord) + CODE: + RETVAL = _isQUOTEMETA(ord); OUTPUT: RETVAL diff --git a/ext/XS-APItest/t/handy.t b/ext/XS-APItest/t/handy.t index 48eb5b9494..f0651cdec9 100644 --- a/ext/XS-APItest/t/handy.t +++ b/ext/XS-APItest/t/handy.t @@ -5,6 +5,378 @@ use Test::More; use XS::APItest; +our @blank = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @upper = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 4F = @ - O +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # C0 - CF = A/GRAVE - I/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @lower = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 6F = ` - o +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, # D0 - DF = ETH - SHARP S +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # E0 - EF = a/GRAVE - i/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # F0 - FF = eth - y/DIARESIS +); + +our @alpha = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 4F = @ - O +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 6F = ` - o +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # C0 - CF = A/GRAVE - I/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # D0 - DF = ETH - SHARP S +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # E0 - EF = a/GRAVE - i/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # F0 - FF = eth - y/DIARESIS +); + +our @digit = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @alnumc = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 4F = @ - O +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 6F = ` - o +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # C0 - CF = A/GRAVE - I/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # D0 - DF = ETH - SHARP S +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # E0 - EF = a/GRAVE - i/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # F0 - FF = eth - y/DIARESIS +); + +our @alnum = ( # Really is \w +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 4F = @ - O +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, # 50 - 5F = P - _ +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 6F = ` - o +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # C0 - CF = A/GRAVE - I/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # D0 - DF = ETH - SHARP S +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # E0 - EF = a/GRAVE - i/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # F0 - FF = eth - y/DIARESIS +); + +our @idfirst = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 4F = @ - O +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, # 50 - 5F = P - _ +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 6F = ` - o +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # C0 - CF = A/GRAVE - I/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # D0 - DF = ETH - SHARP S +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # E0 - EF = a/GRAVE - i/DIARESIS +1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, # F0 - FF = eth - y/DIARESIS +); + +our @space = ( # includes VT for now +0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @psxspc = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @ascii = ( +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 00 - 0F = C0 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 10 - 1F = C0 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 2F = SP - / +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 3F = 0 - ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 4F = @ - O +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 50 - 5F = P - _ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 6F = ` - o +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @cntrl = ( +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 00 - 0F = C0 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, # 70 - 7F = p - DEL +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 80 - 8F = C1 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @graph = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 2F = SP - / +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 3F = 0 - ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 4F = @ - O +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 50 - 5F = P - _ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 6F = ` - o +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # A0 - AF = NBSP - MACRON +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # B0 - BF = DEGREE - INVERTED ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # C0 - CF = A/GRAVE - I/DIARESIS +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # D0 - DF = ETH - SHARP S +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # E0 - EF = a/GRAVE - i/DIARESIS +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # F0 - FF = eth - y/DIARESIS +); + +our @print = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 2F = SP - / +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 3F = 0 - ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 4F = @ - O +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 50 - 5F = P - _ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 6F = ` - o +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # A0 - AF = NBSP - MACRON +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # B0 - BF = DEGREE - INVERTED ? +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # C0 - CF = A/GRAVE - I/DIARESIS +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # D0 - DF = ETH - SHARP S +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # E0 - EF = a/GRAVE - i/DIARESIS +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # F0 - FF = eth - y/DIARESIS +); + +our @punct = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, # 30 - 3F = 0 - ? +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, # 50 - 5F = P - _ +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @xdigit = ( +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 0F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 1F = C0 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 2F = SP - / +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, # 30 - 3F = 0 - ? +0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 5F = P - _ +0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 70 - 7F = p - DEL +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 8F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 9F = C1 controls +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # A0 - AF = NBSP - MACRON +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +our @quotemeta = ( # Certainly isn't a public API member, but tested here + # anyway +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 00 - 0F = C0 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 10 - 1F = C0 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 2F = SP - / +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, # 30 - 3F = 0 - ? +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 4F = @ - O +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, # 50 - 5F = P - _ +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 6F = ` - o +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, # 70 - 7F = p - DEL +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 80 - 8F = C1 controls +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 90 - 9F = C1 controls +1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, # A0 - AF = NBSP - MACRON +1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, # B0 - BF = DEGREE - INVERTED ? +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C0 - CF = A/GRAVE - I/DIARESIS +0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, # D0 - DF = ETH - SHARP S +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E0 - EF = a/GRAVE - i/DIARESIS +0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, # F0 - FF = eth - y/DIARESIS +); + +sub truth($) { + return (shift) ? 1 : ""; +} + +use charnames (); +for (my $i = 0; $i < 256; $i++) { + foreach my $name (qw( alnum + alnumc + alpha + ascii + blank + cntrl + digit + graph + idfirst + lower + print + psxspc + punct + quotemeta + space + upper + xdigit + ) + ) { + my $function = uc($name); + no strict 'refs'; + my $array = *$name{ARRAY}; + use strict 'refs'; + + my $display_name = sprintf "\\N{U+%02X, %s}", $i, charnames::viacode($i); + if ($name eq 'quotemeta') { + is(eval "test_is${function}($i)", truth($array->[$i]), "is${function}( $display_name )"); + next; + } + is(eval "test_is${function}_A($i)", truth($array->[$i] && $i < 128), "is${function}_A( $display_name )"); + is(eval "test_is${function}_L1($i)", truth($array->[$i]), "is${function}_L1( $display_name )"); + next if $name eq 'alnumc'; + + is(eval "test_is${function}_uni($i)", truth($array->[$i]), "is${function}_uni( $display_name )"); + + my $char = chr($i); + utf8::upgrade($char); + $char = quotemeta $char if $char eq '\\' || $char eq "'"; + is(eval "test_is${function}_utf8('$char')", truth($array->[$i]), "is${function}_utf8( $display_name )"); + } +} + ok(test_isBLANK_uni(ord("\N{EM SPACE}")), "EM SPACE is blank in isBLANK_uni()"); ok(test_isBLANK_utf8("\N{EM SPACE}"), "EM SPACE is blank in isBLANK_utf8()"); |