Annotation of embedaddon/php/ext/pcre/tests/bug47229.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #47229 (preg_quote() doesn't escape -)
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: var_dump(preg_quote('-oh really?'));
        !             7: 
        !             8: // make sure there's no regression in matching
        !             9: preg_match('/[a\-c]+/', 'a---b', $m);
        !            10: var_dump($m);
        !            11: 
        !            12: preg_match('/[a\-c]+/', 'a\-', $m);
        !            13: var_dump($m);
        !            14: 
        !            15: preg_match("/a\-{2,}/", 'a----a', $m);
        !            16: var_dump($m);
        !            17: 
        !            18: preg_match("/a\-{1,}/", 'a\----a', $m);
        !            19: var_dump($m);
        !            20: 
        !            21: ?>
        !            22: --EXPECTF--
        !            23: %string|unicode%(13) "\-oh really\?"
        !            24: array(1) {
        !            25:   [0]=>
        !            26:   %string|unicode%(4) "a---"
        !            27: }
        !            28: array(1) {
        !            29:   [0]=>
        !            30:   %string|unicode%(1) "a"
        !            31: }
        !            32: array(1) {
        !            33:   [0]=>
        !            34:   %string|unicode%(5) "a----"
        !            35: }
        !            36: array(0) {
        !            37: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>