In perl.git, the branch smoke-me/nicholas/Devel-Peek-t has been updated <http://perl5.git.perl.org/perl.git/commitdiff/fb5a275549f03e683f87cbf866c51d360b603875?hp=06a5399c14932fbf578b4393f4dabad5927a012d>
- Log ----------------------------------------------------------------- commit fb5a275549f03e683f87cbf866c51d360b603875 Author: Nicholas Clark <[email protected]> Date: Wed Sep 4 15:14:03 2013 +0200 Simplify the conditional logic for COW_REFCNT in Devel::Peek's test. Instead of having a comment on each COW_REFCNT line to skip the line on earlier versions, move the skip into the existing code which skips the same lines on current versions built without COW. M ext/Devel-Peek/t/Peek.t commit e11d0deb7c747b3e375d30550e0e9699e9943197 Author: Nicholas Clark <[email protected]> Date: Wed Sep 4 14:55:00 2013 +0200 Fix Devel::Peek's tests when building with -DPERL_NO_COW One test had a pattern with a (?:...)? construction split across two lines, specifically enclosing the newline at the end of a line, and the line that followed. When perl is built with -DPERL_NO_COW or -DPERL_OLD_COPY_ON_WRITE the test's do_test() driver routine would remove the second line, which included the closing ')?', leaving a an invalid regex. The solution is to remove the (?: )? completely, as the driver routine's line removal has the same intent as the (?: )? construction. M ext/Devel-Peek/t/Peek.t ----------------------------------------------------------------------- Summary of changes: ext/Devel-Peek/t/Peek.t | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t index 929ce79..b55650e 100644 --- a/ext/Devel-Peek/t/Peek.t +++ b/ext/Devel-Peek/t/Peek.t @@ -88,8 +88,8 @@ sub do_test { /mge; $pattern =~ s/^\h+COW_REFCNT = .*\n//mg if $Config{ccflags} =~ - /-DPERL_(?:OLD_COPY_ON_WRITE|NO_COW)/; - + /-DPERL_(?:OLD_COPY_ON_WRITE|NO_COW)/ + || $] < 5.019003; print $pattern, "\n" if $DEBUG; my ($dump, $dump2) = split m/\*\*\*\*\*\n/, scalar <IN>; print $dump, "\n" if $DEBUG; @@ -128,7 +128,7 @@ do_test('assignment of immediate constant (string)', PV = $ADDR "foo"\\\0 CUR = 3 LEN = \\d+ - COW_REFCNT = 1 # $] >=5.019003 + COW_REFCNT = 1 '); do_test('immediate constant (string)', @@ -139,7 +139,7 @@ do_test('immediate constant (string)', PV = $ADDR "bar"\\\0 CUR = 3 LEN = \\d+ - COW_REFCNT = 0 # $] >=5.019003 + COW_REFCNT = 0 '); do_test('assignment of immediate constant (integer)', @@ -224,7 +224,7 @@ do_test('reference to scalar', PV = $ADDR "foo"\\\0 CUR = 3 LEN = \\d+ - COW_REFCNT = 1 # $] >=5.019003 + COW_REFCNT = 1 '); my $c_pattern; @@ -509,7 +509,7 @@ do_test('string with Unicode', PV = $ADDR "\\\214\\\101\\\0\\\235\\\101"\\\0 \[UTF8 "\\\x\{100\}\\\x\{0\}\\\x\{200\}"\] CUR = 5 LEN = \\d+ - COW_REFCNT = 1 # $] >=5.019003 + COW_REFCNT = 1 '); } else { do_test('string with Unicode', @@ -521,7 +521,7 @@ do_test('string with Unicode', PV = $ADDR "\\\304\\\200\\\0\\\310\\\200"\\\0 \[UTF8 "\\\x\{100\}\\\x\{0\}\\\x\{200\}"\] CUR = 5 LEN = \\d+ - COW_REFCNT = 1 # $] >=5.019003 + COW_REFCNT = 1 '); } @@ -549,7 +549,7 @@ do_test('reference to hash containing Unicode', PV = $ADDR "\\\235\\\101"\\\0 \[UTF8 "\\\x\{200\}"\] CUR = 2 LEN = \\d+ - COW_REFCNT = 1 # $] < 5.009 + COW_REFCNT = 1 ', '', $] > 5.009 ? $] >= 5.015 @@ -580,7 +580,7 @@ do_test('reference to hash containing Unicode', PV = $ADDR "\\\310\\\200"\\\0 \[UTF8 "\\\x\{200\}"\] CUR = 2 LEN = \\d+ - COW_REFCNT = 1 # $] >= 5.019003 + COW_REFCNT = 1 ', '', $] > 5.009 ? $] >= 5.015 @@ -697,7 +697,7 @@ do_test('constant subroutine', PV = $ADDR "Perl rules"\\\0 CUR = 10 LEN = \\d+ - COW_REFCNT = 0 # $] >=5.019003 + COW_REFCNT = 0 GVGV::GV = $ADDR\\t"main" :: "const" FILE = ".*\\b(?i:peek\\.t)" DEPTH = 0(?: @@ -896,7 +896,7 @@ do_test('small hash', PV = $ADDR "(?:Rules|Foamy)"\\\0 CUR = \d+ LEN = \d+ - COW_REFCNT = 1 # $] >=5.019003 + COW_REFCNT = 1 ){2}'); $b = keys %small; @@ -927,7 +927,7 @@ do_test('small hash after keys', PV = $ADDR "(?:Rules|Foamy)"\\\0 CUR = \d+ LEN = \d+ - COW_REFCNT = 1 # $] >=5.019003 + COW_REFCNT = 1 ){2}'); $b = %small; @@ -958,7 +958,7 @@ do_test('small hash after keys and scalar', PV = $ADDR "(?:Rules|Foamy)"\\\0 CUR = \d+ LEN = \d+ - COW_REFCNT = 1 # $] >=5.019003 + COW_REFCNT = 1 ){2}'); # This should immediately start with the FILL cached correctly. @@ -1069,7 +1069,7 @@ unless ($Config{useithreads}) { PV = $ADDR "rules"\\\0 CUR = 5 LEN = \d+ - COW_REFCNT = 0 # $] >=5.019003 + COW_REFCNT = 0 '); eval 'index "", perl'; @@ -1085,7 +1085,7 @@ unless ($Config{useithreads}) { PV = $ADDR "rules"\\\0 CUR = 5 LEN = \d+ - COW_REFCNT = 0 # $] >=5.019003 + COW_REFCNT = 0 MAGIC = $ADDR MG_VIRTUAL = &PL_vtbl_regexp MG_TYPE = PERL_MAGIC_bm\\(B\\) @@ -1105,7 +1105,7 @@ unless ($Config{useithreads}) { PV = $ADDR "rules"\\\0 CUR = 5 LEN = \d+ - COW_REFCNT = 0 # $] >=5.019003 + COW_REFCNT = 0 MAGIC = $ADDR MG_VIRTUAL = &PL_vtbl_regexp MG_TYPE = PERL_MAGIC_bm\\(B\\) @@ -1123,7 +1123,7 @@ unless ($Config{useithreads}) { PV = $ADDR "foamy"\\\0 CUR = 5 LEN = \d+ - COW_REFCNT = 0 # $] >=5.019003 + COW_REFCNT = 0 '); is(study beer, 1, "Our studies were successful"); @@ -1134,7 +1134,7 @@ unless ($Config{useithreads}) { PV = $ADDR "foamy"\\\0 CUR = 5 LEN = \d+ - COW_REFCNT = 0 # $] >=5.019003 + COW_REFCNT = 0 '); my $want = 'SV = PVMG\\($ADDR\\) at $ADDR @@ -1143,7 +1143,7 @@ unless ($Config{useithreads}) { PV = $ADDR "foamy"\\\0 CUR = 5 LEN = \d+ - COW_REFCNT = 0 # $] >=5.019003 + COW_REFCNT = 0 MAGIC = $ADDR MG_VIRTUAL = &PL_vtbl_regexp MG_TYPE = PERL_MAGIC_bm\\(B\\) @@ -1169,8 +1169,8 @@ unless ($Config{useithreads}) { FLAGS = \\(PADMY,POK,(?:IsCOW,)?pPOK\\) PV = $ADDR "good"\\\0 CUR = 4 - LEN = \d+(?: - COW_REFCNT = 1)? + LEN = \d+ + COW_REFCNT = 1 '); } -- Perl5 Master Repository
