From 7898bf0b95ce200dc059c9e9b36eb88a4d53ac23 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 9 Jan 2009 17:09:33 +0100 Subject: Test that overload::constant works in eval("") --- lib/overload.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/overload.t') 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'; -- cgit v1.2.1