From cb8a0ec8963ffc4241321c21bae9e9015688c360 Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Tue, 21 Jul 2009 14:05:06 +0000 Subject: [PATCH] DBD-SQLite: skip_all should be in a BEGIN block and be placed before use Test::NoWarnings --- t/13_create_collation.t | 2 +- t/37_regexp.t | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/t/13_create_collation.t b/t/13_create_collation.t index 6693ab6..9f85e2d 100644 --- a/t/13_create_collation.t +++ b/t/13_create_collation.t @@ -8,7 +8,6 @@ BEGIN { use t::lib::Test qw/connect_ok @CALL_FUNCS/; use Test::More; -use Test::NoWarnings; BEGIN { if ( $] >= 5.008005 ) { plan( tests => 10 * @CALL_FUNCS + 1 ); @@ -16,6 +15,7 @@ BEGIN { plan( skip_all => 'Unicode is not supported before 5.8.5' ); } } +use Test::NoWarnings; use Encode qw/decode/; use DBD::SQLite; diff --git a/t/37_regexp.t b/t/37_regexp.t index 50ff97e..42b97e9 100644 --- a/t/37_regexp.t +++ b/t/37_regexp.t @@ -8,7 +8,6 @@ BEGIN { use t::lib::Test qw/connect_ok @CALL_FUNCS/; use Test::More; -use Test::NoWarnings; my @words = qw{ berger Bergère bergère Bergere @@ -19,10 +18,15 @@ my @words = qw{ }; my @regexes = qw( ^b\\w+ (?i:^b\\w+) ); -plan skip_all => 'Unicode is not supported before 5.8.5' - if $] < 5.008005; -plan tests => 2 * (1 + 2 * @regexes) * @CALL_FUNCS + 1 ; - +BEGIN { + if ($] < 5.008005) { + plan skip_all => 'Unicode is not supported before 5.8.5' + } + else { + plan tests => 2 * (1 + 2 * @regexes) * @CALL_FUNCS + 1 ; + } +} +use Test::NoWarnings; BEGIN { # Sadly perl for windows (and probably sqlite, too) may hang