diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-02-28 12:43:02 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-03-19 10:21:53 +0100 |
commit | c4a350e6709d60f02654f36bb02d403e6763ecc1 (patch) | |
tree | e28b8f09c7d40699f79ca0b30f1e8476a0c6712f | |
parent | d333a65555483b42982abcf933ffae2cf0b8a6a9 (diff) | |
download | perl-c4a350e6709d60f02654f36bb02d403e6763ecc1.tar.gz |
In deparse.t, rename %reason to %meta.
Whilst skip and todo both have "reason"s, subsequent refactoring will use it
for other purposes.
-rw-r--r-- | dist/B-Deparse/t/deparse.t | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index cae808c1d0..5b9ab14064 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -43,17 +43,17 @@ while (<DATA>) { # This code is pinched from the t/lib/common.pl for TODO. # It's not clear how to avoid duplication # Now tweaked a bit to do skip or todo - my %reason; + my %meta; foreach my $what (qw(skip todo)) { - s/^#\s*\U$what\E\s*(.*)\n//m and $reason{$what} = $1; + s/^#\s*\U$what\E\s*(.*)\n//m and $meta{$what} = $1; # If the SKIP reason starts ? then it's taken as a code snippet to # evaluate. This provides the flexibility to have conditional SKIPs - if ($reason{$what} && $reason{$what} =~ s/^\?//) { - my $temp = eval $reason{$what}; + if ($meta{$what} && $meta{$what} =~ s/^\?//) { + my $temp = eval $meta{$what}; if ($@) { - die "# In \U$what\E code reason:\n# $reason{$what}\n$@"; + die "# In \U$what\E code reason:\n# $meta{$what}\n$@"; } - $reason{$what} = $temp; + $meta{$what} = $temp; } } @@ -61,9 +61,9 @@ while (<DATA>) { my $desc = $1; die "Missing name in test $_" unless defined $desc; - if ($reason{skip}) { + if ($meta{skip}) { # Like this to avoid needing a label SKIP: - Test::More->builder->skip($reason{skip}); + Test::More->builder->skip($meta{skip}); next; } @@ -87,7 +87,7 @@ while (<DATA>) { $regex =~ s/\s+/\\s+/g; $regex = '^\{\s*' . $regex . '\s*\}$'; - local $::TODO = $reason{todo}; + local $::TODO = $meta{todo}; like($deparsed, qr/$regex/, $desc); } } |