diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-05-04 15:10:45 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-05-04 15:10:45 +0000 |
commit | 2ca8a869b498fa8129ab01b9c698656ff8bf57da (patch) | |
tree | a5285bbf1f5402a3fd1e2f10ffa7685ba637b501 | |
parent | a540da61ce17a7cd521ef8325ed8b2b104456ce4 (diff) | |
download | pcre-2ca8a869b498fa8129ab01b9c698656ff8bf57da.tar.gz |
New test for internal sizes and offsets when link size is 2.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@163 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | testdata/testinput10 | 104 | ||||
-rw-r--r-- | testdata/testoutput10 | 563 |
2 files changed, 667 insertions, 0 deletions
diff --git a/testdata/testinput10 b/testdata/testinput10 new file mode 100644 index 0000000..369af4a --- /dev/null +++ b/testdata/testinput10 @@ -0,0 +1,104 @@ +/-- These are a few representative patterns whose lengths and offsets are to be +shown when the link size is 2. This is just a doublecheck test to ensure the +sizes don't go horribly wrong when something is changed. The pattern contents +are all themselves checked in other tests. --/ + +/((?i)b)/BM + +/(?s)(.*X|^B)/BM + +/(?s:.*X|^B)/BM + +/^[[:alnum:]]/BM + +/#/IxMD + +/a#/IxMD + +/x?+/BM + +/x++/BM + +/x{1,3}+/BM + +/(x)*+/BM + +/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/BM + +|8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\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/\x{4000000}/8BM + +/\x{7fffFFFF}/8BM + +/[\x{ff}]/8BM + +/[\x{100}]/8BM + +/\x80/8BM + +/\xff/8BM + +/\x{0041}\x{2262}\x{0391}\x{002e}/D8M + +/\x{D55c}\x{ad6d}\x{C5B4}/D8M + +/\x{65e5}\x{672c}\x{8a9e}/D8M + +/[\x{100}]/8BM + +/[Z\x{100}]/8BM + +/^[\x{100}\E-\Q\E\x{150}]/B8M + +/^[\QĀ\E-\QŐ\E]/B8M + +/^[\QĀ\E-\QŐ\E/B8M + +/[\p{L}]/BM + +/[\p{^L}]/BM + +/[\P{L}]/BM + +/[\P{^L}]/BM + +/[abc\p{L}\x{0660}]/8BM + +/[\p{Nd}]/8BM + +/[\p{Nd}+-]+/8BM + +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iBM + +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8BM + +/[\x{105}-\x{109}]/8iBM + +/ End of testinput10 / diff --git a/testdata/testoutput10 b/testdata/testoutput10 new file mode 100644 index 0000000..bfda261 --- /dev/null +++ b/testdata/testoutput10 @@ -0,0 +1,563 @@ +/-- These are a few representative patterns whose lengths and offsets are to be +shown when the link size is 2. This is just a doublecheck test to ensure the +sizes don't go horribly wrong when something is changed. The pattern contents +are all themselves checked in other tests. --/ + +/((?i)b)/BM +Memory allocation (code space): 21 +------------------------------------------------------------------ + 0 17 Bra 0 + 3 9 Bra 1 + 8 01 Opt + 10 NC b + 12 9 Ket + 15 00 Opt + 17 17 Ket + 20 End +------------------------------------------------------------------ + +/(?s)(.*X|^B)/BM +Memory allocation (code space): 25 +------------------------------------------------------------------ + 0 21 Bra 0 + 3 9 Bra 1 + 8 Any* + 10 X + 12 6 Alt + 15 ^ + 16 B + 18 15 Ket + 21 21 Ket + 24 End +------------------------------------------------------------------ + +/(?s:.*X|^B)/BM +Memory allocation (code space): 29 +------------------------------------------------------------------ + 0 25 Bra 0 + 3 9 Bra 0 + 6 04 Opt + 8 Any* + 10 X + 12 8 Alt + 15 04 Opt + 17 ^ + 18 B + 20 17 Ket + 23 00 Opt + 25 25 Ket + 28 End +------------------------------------------------------------------ + +/^[[:alnum:]]/BM +Memory allocation (code space): 41 +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9A-Za-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ + +/#/IxMD +Memory allocation (code space): 7 +------------------------------------------------------------------ + 0 3 Bra 0 + 3 3 Ket + 6 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: extended +No first char +No need char + +/a#/IxMD +Memory allocation (code space): 9 +------------------------------------------------------------------ + 0 5 Bra 0 + 3 a + 5 5 Ket + 8 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: extended +First char = 'a' +No need char + +/x?+/BM +Memory allocation (code space): 9 +------------------------------------------------------------------ + 0 5 Bra 0 + 3 x?+ + 5 5 Ket + 8 End +------------------------------------------------------------------ + +/x++/BM +Memory allocation (code space): 9 +------------------------------------------------------------------ + 0 5 Bra 0 + 3 x++ + 5 5 Ket + 8 End +------------------------------------------------------------------ + +/x{1,3}+/BM +Memory allocation (code space): 19 +------------------------------------------------------------------ + 0 15 Bra 0 + 3 9 Once + 6 x + 8 x{0,2} + 12 9 Ket + 15 15 Ket + 18 End +------------------------------------------------------------------ + +/(x)*+/BM +Memory allocation (code space): 24 +------------------------------------------------------------------ + 0 20 Bra 0 + 3 14 Once + 6 Brazero + 7 7 Bra 1 + 12 x + 14 7 KetRmax + 17 14 Ket + 20 20 Ket + 23 End +------------------------------------------------------------------ + +/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/BM +Memory allocation (code space): 120 +------------------------------------------------------------------ + 0 116 Bra 0 + 3 ^ + 4 109 Bra 1 + 9 7 Bra 2 + 14 a+ + 16 7 Ket + 19 39 Bra 3 + 24 [ab]+? + 58 39 Ket + 61 39 Bra 4 + 66 [bc]+ +100 39 Ket +103 7 Bra 5 +108 \w* +110 7 Ket +113 109 Ket +116 116 Ket +119 End +------------------------------------------------------------------ + +|8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM +Memory allocation (code space): 826 +------------------------------------------------------------------ + 0 822 Bra 0 + 3 8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X +821 \b +822 822 Ket +825 End +------------------------------------------------------------------ + +|\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM +Memory allocation (code space): 816 +------------------------------------------------------------------ + 0 812 Bra 0 + 3 $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X +811 \b +812 812 Ket +815 End +------------------------------------------------------------------ + +/(a(?1)b)/BM +Memory allocation (code space): 28 +------------------------------------------------------------------ + 0 24 Bra 0 + 3 18 Bra 1 + 8 a + 10 6 Once + 13 3 Recurse + 16 6 Ket + 19 b + 21 18 Ket + 24 24 Ket + 27 End +------------------------------------------------------------------ + +/(a(?1)+b)/BM +Memory allocation (code space): 28 +------------------------------------------------------------------ + 0 24 Bra 0 + 3 18 Bra 1 + 8 a + 10 6 Once + 13 3 Recurse + 16 6 KetRmax + 19 b + 21 18 Ket + 24 24 Ket + 27 End +------------------------------------------------------------------ + +/a(?P<name1>b|c)d(?P<longername2>e)/BM +Memory allocation (code space): 42 +------------------------------------------------------------------ + 0 32 Bra 0 + 3 a + 5 7 Bra 1 + 10 b + 12 5 Alt + 15 c + 17 12 Ket + 20 d + 22 7 Bra 2 + 27 e + 29 7 Ket + 32 32 Ket + 35 End +------------------------------------------------------------------ + +/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/BM +Memory allocation (code space): 54 +------------------------------------------------------------------ + 0 41 Bra 0 + 3 25 Bra 0 + 6 a + 8 17 Bra 1 + 13 c + 15 7 Bra 2 + 20 d + 22 7 Ket + 25 17 Ket + 28 25 Ket + 31 7 Bra 3 + 36 a + 38 7 Ket + 41 41 Ket + 44 End +------------------------------------------------------------------ + +/(?P<a>a)...(?P=a)bbb(?P>a)d/BM +Memory allocation (code space): 43 +------------------------------------------------------------------ + 0 36 Bra 0 + 3 7 Bra 1 + 8 a + 10 7 Ket + 13 Any + 14 Any + 15 Any + 16 \1 + 19 bbb + 25 6 Once + 28 3 Recurse + 31 6 Ket + 34 d + 36 36 Ket + 39 End +------------------------------------------------------------------ + +/abc(?C255)de(?C)f/BM +Memory allocation (code space): 31 +------------------------------------------------------------------ + 0 27 Bra 0 + 3 abc + 9 Callout 255 10 1 + 15 de + 19 Callout 0 16 1 + 25 f + 27 27 Ket + 30 End +------------------------------------------------------------------ + +/abcde/CBM +Memory allocation (code space): 53 +------------------------------------------------------------------ + 0 49 Bra 0 + 3 Callout 255 0 1 + 9 a + 11 Callout 255 1 1 + 17 b + 19 Callout 255 2 1 + 25 c + 27 Callout 255 3 1 + 33 d + 35 Callout 255 4 1 + 41 e + 43 Callout 255 5 0 + 49 49 Ket + 52 End +------------------------------------------------------------------ + +/\x{100}/8BM +Memory allocation (code space): 10 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{100} + 6 6 Ket + 9 End +------------------------------------------------------------------ + +/\x{1000}/8BM +Memory allocation (code space): 11 +------------------------------------------------------------------ + 0 7 Bra 0 + 3 \x{1000} + 7 7 Ket + 10 End +------------------------------------------------------------------ + +/\x{10000}/8BM +Memory allocation (code space): 12 +------------------------------------------------------------------ + 0 8 Bra 0 + 3 \x{10000} + 8 8 Ket + 11 End +------------------------------------------------------------------ + +/\x{100000}/8BM +Memory allocation (code space): 12 +------------------------------------------------------------------ + 0 8 Bra 0 + 3 \x{100000} + 8 8 Ket + 11 End +------------------------------------------------------------------ + +/\x{1000000}/8BM +Memory allocation (code space): 13 +------------------------------------------------------------------ + 0 9 Bra 0 + 3 \x{1000000} + 9 9 Ket + 12 End +------------------------------------------------------------------ + +/\x{4000000}/8BM +Memory allocation (code space): 14 +------------------------------------------------------------------ + 0 10 Bra 0 + 3 \x{4000000} + 10 10 Ket + 13 End +------------------------------------------------------------------ + +/\x{7fffFFFF}/8BM +Memory allocation (code space): 14 +------------------------------------------------------------------ + 0 10 Bra 0 + 3 \x{7fffffff} + 10 10 Ket + 13 End +------------------------------------------------------------------ + +/[\x{ff}]/8BM +Memory allocation (code space): 10 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{ff} + 6 6 Ket + 9 End +------------------------------------------------------------------ + +/[\x{100}]/8BM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\x{100}] + 11 11 Ket + 14 End +------------------------------------------------------------------ + +/\x80/8BM +Memory allocation (code space): 10 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{80} + 6 6 Ket + 9 End +------------------------------------------------------------------ + +/\xff/8BM +Memory allocation (code space): 10 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{ff} + 6 6 Ket + 9 End +------------------------------------------------------------------ + +/\x{0041}\x{2262}\x{0391}\x{002e}/D8M +Memory allocation (code space): 18 +------------------------------------------------------------------ + 0 14 Bra 0 + 3 A\x{2262}\x{391}. + 14 14 Ket + 17 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 'A' +Need char = '.' + +/\x{D55c}\x{ad6d}\x{C5B4}/D8M +Memory allocation (code space): 19 +------------------------------------------------------------------ + 0 15 Bra 0 + 3 \x{d55c}\x{ad6d}\x{c5b4} + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 237 +Need char = 180 + +/\x{65e5}\x{672c}\x{8a9e}/D8M +Memory allocation (code space): 19 +------------------------------------------------------------------ + 0 15 Bra 0 + 3 \x{65e5}\x{672c}\x{8a9e} + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 230 +Need char = 158 + +/[\x{100}]/8BM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\x{100}] + 11 11 Ket + 14 End +------------------------------------------------------------------ + +/[Z\x{100}]/8BM +Memory allocation (code space): 47 +------------------------------------------------------------------ + 0 43 Bra 0 + 3 [Z\x{100}] + 43 43 Ket + 46 End +------------------------------------------------------------------ + +/^[\x{100}\E-\Q\E\x{150}]/B8M +Memory allocation (code space): 18 +------------------------------------------------------------------ + 0 14 Bra 0 + 3 ^ + 4 [\x{100}-\x{150}] + 14 14 Ket + 17 End +------------------------------------------------------------------ + +/^[\QĀ\E-\QŐ\E]/B8M +Memory allocation (code space): 18 +------------------------------------------------------------------ + 0 14 Bra 0 + 3 ^ + 4 [\x{100}-\x{150}] + 14 14 Ket + 17 End +------------------------------------------------------------------ + +/^[\QĀ\E-\QŐ\E/B8M +Failed: missing terminating ] for character class at offset 15 + +/[\p{L}]/BM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\p{L}] + 11 11 Ket + 14 End +------------------------------------------------------------------ + +/[\p{^L}]/BM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\P{L}] + 11 11 Ket + 14 End +------------------------------------------------------------------ + +/[\P{L}]/BM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\P{L}] + 11 11 Ket + 14 End +------------------------------------------------------------------ + +/[\P{^L}]/BM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\p{L}] + 11 11 Ket + 14 End +------------------------------------------------------------------ + +/[abc\p{L}\x{0660}]/8BM +Memory allocation (code space): 50 +------------------------------------------------------------------ + 0 46 Bra 0 + 3 [a-c\p{L}\x{660}] + 46 46 Ket + 49 End +------------------------------------------------------------------ + +/[\p{Nd}]/8BM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\p{Nd}] + 11 11 Ket + 14 End +------------------------------------------------------------------ + +/[\p{Nd}+-]+/8BM +Memory allocation (code space): 48 +------------------------------------------------------------------ + 0 44 Bra 0 + 3 [+\-\p{Nd}]+ + 44 44 Ket + 47 End +------------------------------------------------------------------ + +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iBM +Memory allocation (code space): 25 +------------------------------------------------------------------ + 0 21 Bra 0 + 3 NC A\x{391}\x{10427}\x{ff3a}\x{1fb0} + 21 21 Ket + 24 End +------------------------------------------------------------------ + +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8BM +Memory allocation (code space): 25 +------------------------------------------------------------------ + 0 21 Bra 0 + 3 A\x{391}\x{10427}\x{ff3a}\x{1fb0} + 21 21 Ket + 24 End +------------------------------------------------------------------ + +/[\x{105}-\x{109}]/8iBM +Memory allocation (code space): 17 +------------------------------------------------------------------ + 0 13 Bra 0 + 3 [\x{104}-\x{109}] + 13 13 Ket + 16 End +------------------------------------------------------------------ + +/ End of testinput10 / |