From: Rafael Garcia-Suarez Date: Wed, 28 Feb 2007 08:45:55 +0000 (+0000) Subject: Add new tests for keys in %+ and %- X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e44c95bb96e4819206b25a8b74f5b8c4069c432d;p=p5sagit%2Fp5-mst-13.2.git Add new tests for keys in %+ and %- p4raw-id: //depot/perl@30423 --- diff --git a/t/op/pat.t b/t/op/pat.t index fe2eef6..5bc68d7 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -4361,11 +4361,31 @@ ok($@=~/\QSequence \k... not terminated in regex;\E/); iseq($_,"!Bang!1!Bang!2!Bang!3!Bang!"); } +# test for keys in %+ and %- +{ + my $_ = "abcdef"; + /(?a)|(?b)/; + iseq( (join ",", sort keys %+), "foo" ); + iseq( (join ",", sort keys %-), "foo" ); + iseq( (join ",", sort values %+), "a" ); + iseq( (join ",", sort map "@$_", values %-), "a " ); + /(?a)(?b)(?.)/; + iseq( (join ",", sort keys %+), "bar,quux" ); + iseq( (join ",", sort keys %-), "bar,quux" ); + iseq( (join ",", sort values %+), "a,c" ); # leftmost + iseq( (join ",", sort map "@$_", values %-), "a b,c" ); + /(?a)(?c)?/; # second buffer won't capture + iseq( (join ",", sort keys %+), "un" ); + iseq( (join ",", sort keys %-), "deux,un" ); + iseq( (join ",", sort values %+), "a" ); + iseq( (join ",", sort map "@$_", values %-), ",a" ); +} + # Put new tests above the dotted line about a page above this comment iseq(0+$::test,$::TestCount,"Got the right number of tests!"); # Don't forget to update this! BEGIN { - $::TestCount = 1638; + $::TestCount = 1650; print "1..$::TestCount\n"; }