diff options
author | Abigail <abigail@abigail.be> | 2010-08-19 18:37:11 +0200 |
---|---|---|
committer | Abigail <abigail@abigail.be> | 2010-08-19 18:37:11 +0200 |
commit | a9f6cb1f22586fafc61c53a46e01a0a4452dbbbb (patch) | |
tree | 31d4ffdbdf43c2c46081edc0c58e0f2bcf20ad76 /t | |
parent | 5bd0cfd283960d1462230a7c58e7349ce360ce7a (diff) | |
download | perl-a9f6cb1f22586fafc61c53a46e01a0a4452dbbbb.tar.gz |
Added a test for bug #77084.
Diffstat (limited to 't')
-rw-r--r-- | t/re/overload.t | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/t/re/overload.t b/t/re/overload.t new file mode 100644 index 0000000000..46407aef74 --- /dev/null +++ b/t/re/overload.t @@ -0,0 +1,39 @@ +#!./perl + +use strict; +use warnings; +no warnings 'syntax'; + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +sub is; +sub plan; + +require './test.pl'; +plan tests => 3; + +{ + # Bug #77084 points out a corruption problem when scalar //g is used + # on overloaded objects. + + my $TAG = "foo:bar"; + use overload '""' => sub {$TAG}; + + my $o = bless []; + my ($one) = $o =~ /(.*)/g; + is $one, $TAG, "list context //g against overloaded object"; + + local our $TODO = "Bug #77084"; + + my $r = $o =~ /(.*)/g; + is $1, $TAG, "scalar context //g against overloaded object"; + + $o =~ /(.*)/g; + is $1, $TAG, "void context //g against overloaded object"; +} + + +__END__ |