From: Vincent Pit Date: Mon, 1 Sep 2008 08:14:43 +0000 (+0200) Subject: Fix the caller-into-block test that was actually testing nothing. Also use __LINE__... X-Git-Tag: v0.20~21 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=b1c000770cd87f795f7d0873d82ea72d3d1601bd;p=perl%2Fmodules%2FVariable-Magic.git Fix the caller-into-block test that was actually testing nothing. Also use __LINE__ instead of hardcoding line numbers --- diff --git a/t/14-callbacks.t b/t/14-callbacks.t index 7a7948c..3cc6d93 100644 --- a/t/14-callbacks.t +++ b/t/14-callbacks.t @@ -41,25 +41,27 @@ cast $b, $wiz; my $u = $b; is_deeply(\@callers, [ - [ 'main', $0, 42 ], + [ 'main', $0, __LINE__-2 ], ], 'caller into callback returns the right thing'); @callers = (); $u = $b; is_deeply(\@callers, [ - [ 'main', $0, 48 ], + [ 'main', $0, __LINE__-2 ], ], 'caller into callback returns the right thing (second time)'); { - my $u = $b; @callers = (); - is_deeply(\@callers, [ ], 'caller into callback into block returns the right thing'); + my $u = $b; + is_deeply(\@callers, [ + [ 'main', $0, __LINE__-2 ] + ], 'caller into callback into block returns the right thing'); } @callers = (); eval { my $u = $b }; is($@, '', 'caller into callback doesn\'t croak'); is_deeply(\@callers, [ - [ 'main', $0, 60 ], - [ 'main', $0, 60 ], + [ 'main', $0, __LINE__-3 ], + [ 'main', $0, __LINE__-4 ], ], 'caller into callback into eval returns the right thing');