Permalink
Browse files

cleaned up lexical test

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 a154dcc686d3a4e84f3852f14febc36d7b829eae
Showing with 7 additions and 7 deletions.
  1. +4 −3 t/lexical.t
  2. +3 −4 t/lib/perl5/tlex.pm
View
@@ -1,7 +1,8 @@
use Test::More 0.88;
-use Test::Exception;
use lib 't/lib';
+BEGIN { plan skip_all => 'Perl version too low to test switch feature' unless $] >= 5.010 };
+
use perl5-tlex;
@@ -11,8 +12,8 @@ like $@, qr/requires explicit package name/, 'got strict';
eval '6 + "fred"';
like $@, qr/isn't numeric/, 'got fatal warnings';
-#eval 'try {die} catch {};';
-#is $@, '', 'try/catch syntax imported';
+eval 'given (1) { when (1) {} }';
+is $@, '', 'switch syntax imported';
done_testing;
View
@@ -3,10 +3,9 @@ use base 'perl5';
sub imports
{
- strict => [qw(subs refs vars)],
- warnings => [FATAL => 'all'], # easier to test
- #TryCatch =>
- # maybe more here later
+ strict => [qw(subs refs vars)],
+ warnings => [FATAL => 'all'], # easier to test
+ feature => ['switch'], # means we must be 5.10 or higher
}
1;

0 comments on commit a154dcc

Please sign in to comment.