From: Rafael Garcia-Suarez Date: Fri, 9 Jan 2009 16:09:33 +0000 (+0100) Subject: Test that overload::constant works in eval("") X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7898bf0b95ce200dc059c9e9b36eb88a4d53ac23;p=p5sagit%2Fp5-mst-13.2.git Test that overload::constant works in eval("") --- diff --git a/lib/overload.t b/lib/overload.t index f10e092..1f9bc1b 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';