diff options
author | David Mitchell <davem@iabyn.com> | 2019-04-19 12:57:48 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-04-19 12:57:48 +0100 |
commit | a601b139b0c8d48eefc9dd3661eccc4a272d1bcc (patch) | |
tree | 10ea729e31ba32a854d4de4a79376a6b786e1151 | |
parent | 9770e07bfa784e7e2acc67585691017b56cadb6f (diff) | |
download | perl-a601b139b0c8d48eefc9dd3661eccc4a272d1bcc.tar.gz |
Deparse: mark "$a[0]\[1]" TODO
Currently Deparse fails to output a backslash, turning the result
into a multi-dimensional array lookup. This is a long-standing fault.
For now, mark it TODO, and remove the construct from uni/fold.t, which is
where I first spotted the issue by running 'TEST -deparse'.
-rw-r--r-- | lib/B/Deparse.t | 4 | ||||
-rw-r--r-- | t/uni/fold.t | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index 138563af7e..384c56c11f 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -3058,3 +3058,7 @@ $l = $s->$#*; $s->$#* = 1; $l = $#{@$s;}; $#{$s;} = 1; +#### +# TODO doesn't preserve backslash +my @a; +my $s = "$a[0]\[1]"; diff --git a/t/uni/fold.t b/t/uni/fold.t index a557fe3354..bd1dd8596b 100644 --- a/t/uni/fold.t +++ b/t/uni/fold.t @@ -166,7 +166,8 @@ foreach my $test_ref (@CF) { $test = qq[":$c:" =~ /:$every_other_bracketed_f:/iu]; ok eval $test, "$code - $name - $mapping - $type - $test"; - my $other_every_bracketed_f = "$f_chars[0]\[$f_chars[1]]"; + my $other_every_bracketed_f = "$f_chars[0]"; + $other_every_bracketed_f .= "[$f_chars[1]]"; $other_every_bracketed_f .= "$f_chars[2]" if $f_chars[2]; $test = qq[":$c:" =~ /:$other_every_bracketed_f:/iu]; ok eval $test, "$code - $name - $mapping - $type - $test"; |