diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-01-09 17:09:33 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-01-12 09:21:59 +0100 |
commit | 7898bf0b95ce200dc059c9e9b36eb88a4d53ac23 (patch) | |
tree | c5a4b473d8ed2fbef4a3f20cb82c43c0c3148ddc /lib/overload.t | |
parent | 8a646e0bef48e453eac933b9fdf6710ec6285257 (diff) | |
download | perl-7898bf0b95ce200dc059c9e9b36eb88a4d53ac23.tar.gz |
Test that overload::constant works in eval("")
Diffstat (limited to 'lib/overload.t')
-rw-r--r-- | lib/overload.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/overload.t b/lib/overload.t index f10e09255c..1f9bc1ba2f 100644 --- a/lib/overload.t +++ b/lib/overload.t @@ -47,7 +47,7 @@ sub numify { 0 + "${$_[0]}" } # Not needed, additional overhead package main; $| = 1; -use Test::More tests => 574; +use Test::More tests => 577; $a = new Oscalar "087"; @@ -361,6 +361,13 @@ is(($aII << 3), '_<<_087_<<_'); } is($int, 9); is($out, 1024); +is($int, 9); +{ + BEGIN { overload::constant 'integer' => sub {$int++; shift()+1}; } + eval q{$out = 42}; +} +is($int, 10); +is($out, 43); $foo = 'foo'; $foo1 = 'f\'o\\o'; |