From: Vincent Pit Date: Thu, 28 Aug 2008 09:37:34 +0000 (+0200) Subject: Skip __LINE__ and __FILE__. Use __LINE__ in the tests X-Git-Tag: v0.02~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=8d2bccf19c13e6c8105cf04cb13481dfe133014f;p=perl%2Fmodules%2Fsubs-auto.git Skip __LINE__ and __FILE__. Use __LINE__ in the tests --- diff --git a/lib/subs/auto.pm b/lib/subs/auto.pm index 13568ac..08f38e2 100644 --- a/lib/subs/auto.pm +++ b/lib/subs/auto.pm @@ -78,7 +78,7 @@ my @core = qw/abs accept alarm atan2 bind binmode bless break caller chdir time times truncate uc ucfirst umask undef unlink unpack unshift untie use utime values vec wait waitpid wantarray warn when write/; -push @core,qw/not/; +push @core,qw/not __LINE__ __FILE__/; my %core; @core{@core} = (); diff --git a/t/10-base.t b/t/10-base.t index 70a8985..f3eaee6 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -70,7 +70,7 @@ _got_ok('compiling to wut()'); use subs::auto; eval { onlycalledonce 1, 2 }; -_got_undefined('onlycalledonce', 72); +_got_undefined('onlycalledonce', __LINE__-1); eval { Test::More->import() }; _got_ok('don\'t touch class names'); @@ -101,7 +101,7 @@ _got_ok('compiling to wut(13,"what")'); is($wut, 17, 'wut really was executed'); eval { qux }; -_got_undefined('qux', 103); +_got_undefined('qux', __LINE__-1); { no strict 'refs'; @@ -117,10 +117,10 @@ _got_undefined('qux', 103); } eval { no warnings; no strict; qux }; -_got_undefined('qux', 119); +_got_undefined('qux', __LINE__-1); eval { no warnings; no strict; blech }; -_got_undefined('blech', 122); +_got_undefined('blech', __LINE__-1); sub foo { if ($_[2]) { @@ -160,10 +160,10 @@ is($blech, 7, 'blech really was executed'); is($warn, undef, 'no redefine warning'); eval { qux }; -_got_undefined('qux', 162); +_got_undefined('qux', __LINE__-1); eval { blech }; -_got_undefined('blech', 165); +_got_undefined('blech', __LINE__-1); # === Up to there ============================================================= no subs::auto; @@ -224,7 +224,7 @@ _got_undefined('blech', 1, eval => 1); sub blech; eval { blech }; -_got_undefined('blech', 226); +_got_undefined('blech', __LINE__-1); sub flop;