X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fsubstr.t;h=4d3bbce92726cf9b9b745d4085b677bdf7bc7164;hb=22d4bb9ccb8701e68f9243547d7e3a3c55f70908;hp=f2a0c6c4fee7c34a890f091d2e32cbe5588381b6;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/substr.t b/t/op/substr.t index f2a0c6c..4d3bbce 100755 --- a/t/op/substr.t +++ b/t/op/substr.t @@ -1,12 +1,12 @@ #!./perl -print "1..135\n"; +print "1..136\n"; #P = start of string Q = start of substr R = end of substr S = end of string BEGIN { chdir 't' if -d 't'; - unshift @INC, '../lib'; + @INC = '../lib'; } use warnings ; @@ -297,3 +297,10 @@ ok 125, $a eq 'xxxxefgh'; ok 134, length($z) == 5; ok 135, $z eq "21\x{263a}10"; } + +# replacement should work on magical values +require Tie::Scalar; +my %data; +tie $data{'a'}, 'Tie::StdScalar'; # makes $data{'a'} magical +$data{a} = "firstlast"; +ok 136, substr($data{'a'}, 0, 5, "") eq "first" && $data{'a'} eq "last";