Skip to content

Commit

Permalink
cleaned up lexical test
Browse files Browse the repository at this point in the history
removed useless test dependency
replaced commented out test with good ones
added perl version dependency
general tidying
  • Loading branch information
barefootcoder committed Jun 20, 2012
1 parent bc824cc commit a154dcc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions t/lexical.t
@@ -1,7 +1,8 @@
use Test::More 0.88; use Test::More 0.88;
use Test::Exception;
use lib 't/lib'; use lib 't/lib';


BEGIN { plan skip_all => 'Perl version too low to test switch feature' unless $] >= 5.010 };

use perl5-tlex; use perl5-tlex;




Expand All @@ -11,8 +12,8 @@ like $@, qr/requires explicit package name/, 'got strict';
eval '6 + "fred"'; eval '6 + "fred"';
like $@, qr/isn't numeric/, 'got fatal warnings'; like $@, qr/isn't numeric/, 'got fatal warnings';


#eval 'try {die} catch {};'; eval 'given (1) { when (1) {} }';
#is $@, '', 'try/catch syntax imported'; is $@, '', 'switch syntax imported';




done_testing; done_testing;
7 changes: 3 additions & 4 deletions t/lib/perl5/tlex.pm
Expand Up @@ -3,10 +3,9 @@ use base 'perl5';


sub imports sub imports
{ {
strict => [qw(subs refs vars)], strict => [qw(subs refs vars)],
warnings => [FATAL => 'all'], # easier to test warnings => [FATAL => 'all'], # easier to test
#TryCatch => feature => ['switch'], # means we must be 5.10 or higher
# maybe more here later
} }


1; 1;

0 comments on commit a154dcc

Please sign in to comment.