Skip to content

Commit

Permalink
s:g/«eval»/EVAL/
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jan 18, 2014
1 parent b17830c commit 8b39acb
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 50 deletions.
84 changes: 42 additions & 42 deletions t/10-mysql.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ok $drh_version > 0, "DBDish::mysql version $drh_version"; # test 2
#-----------------------------------------------------------------------
# from perl5 DBD/mysql/t/10connect.t
#plan tests => 2;
#eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
#EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
# { RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
#ok defined $dbh, "Connected to database";
#ok $dbh->disconnect();
Expand Down Expand Up @@ -127,7 +127,7 @@ lives_ok({$dbh.do("DROP TABLE $table")}, "dropping created $table"); # test 8
#ok $dbh->do("LOCK TABLES $table WRITE"), "lock table $table";
#ok $dbh->do("INSERT INTO $table VALUES(1, 'Alligator Descartes')"), "Insert ";
#ok $dbh->do("DELETE FROM $table WHERE id = 1"), "Delete";
#eval {$sth= $dbh->prepare("SELECT * FROM $table WHERE id = 1")};
#EVAL {$sth= $dbh->prepare("SELECT * FROM $table WHERE id = 1")};
#ok !$@, "Prepare of select";
#ok defined($sth), "Prepare of select";
#ok $sth->execute , "Execute";
Expand Down Expand Up @@ -273,8 +273,8 @@ try {
#ok (my $sth = $dbh->prepare($query));
#ok $sth->execute(1, "Jocken");
#$sth->{PrintError} = 0;
#eval {$sth->execute(1, "Jochen")};
#ok defined($@), 'fails with duplicate entry'; # $@ is last eval error message
#EVAL {$sth->execute(1, "Jochen")};
#ok defined($@), 'fails with duplicate entry'; # $@ is last EVAL error message
#$sth->{PrintError} = 1;
#ok $sth->execute(2, "Jochen");
#ok $sth->finish;
Expand Down Expand Up @@ -532,7 +532,7 @@ ok ($sth.execute($numericVal, $charVal)),"insert with number for numeric"; # tes

#-----------------------------------------------------------------------
# from perl5 DBD/mysql/t/40bindparam2.t
#eval {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
#EVAL {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
# { RaiseError => 1, AutoCommit => 1}) or ServerError();};
#if ($@) {
# plan skip_all => "ERROR: $DBI::errstr. Can't continue test";
Expand Down Expand Up @@ -626,7 +626,7 @@ ok ($sth.execute($numericVal, $charVal)),"insert with number for numeric"; # tes
=begin pod
#-----------------------------------------------------------------------
# from perl5 DBD/mysql/t/40catalog.t
#eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
#EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
# { RaiseError => 1,
# PrintError => 1,
# AutoCommit => 0,
Expand Down Expand Up @@ -906,7 +906,7 @@ $|= 1;
use vars qw($table $test_dsn $test_user $test_password);
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
Expand Down Expand Up @@ -968,7 +968,7 @@ my $quoted;
my $create;
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
Expand Down Expand Up @@ -1040,13 +1040,13 @@ ok($sth->execute);
ok (! defined $sth->{'NUM_OF_FIELDS'});
$quoted = eval { $dbh->quote(0, DBI::SQL_INTEGER()) };
$quoted = EVAL { $dbh->quote(0, DBI::SQL_INTEGER()) };
ok (!$@);
cmp_ok $quoted, 'eq', '0', "equals '0'";
$quoted = eval { $dbh->quote('abc', DBI::SQL_VARCHAR()) };
$quoted = EVAL { $dbh->quote('abc', DBI::SQL_VARCHAR()) };
ok (!$@);
Expand All @@ -1069,7 +1069,7 @@ use lib 't', '.';
require 'lib.pl';
my ($dbh, $sth);
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all =>
Expand Down Expand Up @@ -1122,7 +1122,7 @@ use lib 't', '.';
require 'lib.pl';
my ($dbh, $sth, $aref);
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all =>
Expand Down Expand Up @@ -1214,7 +1214,7 @@ use vars qw($test_dsn $test_user $test_password);
$test_dsn.= ";mysql_server_prepare=1";
my $dbh;
eval {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, AutoCommit => 1})};
if ($@) {
Expand All @@ -1236,7 +1236,7 @@ my $q = "select select select"; # invalid SQL
$dbh->{PrintError} = 0;
$dbh->{PrintWarn} = 0;
my $sth;
eval {$sth = $dbh->prepare($q);};
EVAL {$sth = $dbh->prepare($q);};
$dbh->{PrintError} = 1;
$dbh->{PrintWarn} = 1;
ok defined($DBI::errstr);
Expand All @@ -1259,7 +1259,7 @@ $|= 1;
$test_dsn.= ";mysql_server_prepare=1";
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
Expand Down Expand Up @@ -1330,7 +1330,7 @@ $|= 1;
use vars qw($table $test_dsn $test_user $test_password);
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
print "err perl $@\n";
if ($@) {
Expand Down Expand Up @@ -1403,7 +1403,7 @@ use lib 't', '.';
require 'lib.pl';
my ($dbh, $sth);
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all =>
Expand Down Expand Up @@ -1458,7 +1458,7 @@ use lib 't', '.';
require 'lib.pl';
my ($dbh, $row);
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all => "ERROR: $DBI::errstr. Can't continue test";
Expand Down Expand Up @@ -1553,7 +1553,7 @@ use lib 't', '.';
require 'lib.pl';
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all => "ERROR: $@. Can't continue test";
Expand Down Expand Up @@ -1609,7 +1609,7 @@ require 'lib.pl';
use vars qw($test_dsn $test_user $test_password $table);
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all =>
Expand Down Expand Up @@ -1684,7 +1684,7 @@ require 'lib.pl';
use vars qw($got_warning $test_dsn $test_user $test_password $table);
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all =>
Expand Down Expand Up @@ -1815,7 +1815,7 @@ EOT
$got_warning = 0;
eval { $result = $dbh->commit; };
EVAL { $result = $dbh->commit; };
$SIG{__WARN__} = 'DEFAULT';
Expand All @@ -1829,7 +1829,7 @@ EOT
$@ = '';
$SIG{__WARN__} = \&catch_warning;
$got_warning = 0;
eval { $result = $dbh->rollback; };
EVAL { $result = $dbh->rollback; };
$SIG{__WARN__} = 'DEFAULT';
ok $got_warning, "Should be warning defined upon rollback of non-trx table";
Expand All @@ -1852,7 +1852,7 @@ require 'lib.pl';
use vars qw($test_dsn $test_user $test_password $table);
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all =>
Expand Down Expand Up @@ -1941,7 +1941,7 @@ use lib 't', '.';
require 'lib.pl';
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all => "ERROR: $@. Can't continue test";
Expand Down Expand Up @@ -2004,7 +2004,7 @@ cmp_ok $ref->[0], 'eq', $utf8_str;
cmp_ok $ref->[3], 'eq', $utf8_str;
SKIP: {
eval {use Encode;};
EVAL {use Encode;};
skip "Can't test is_utf8 tests 'use Encode;' not available", 2, if $@;
ok !Encode::is_utf8($ref->[1]), "blob was made utf8!.";
Expand Down Expand Up @@ -2044,16 +2044,16 @@ if (!$ENV{SLOW_TESTS}) {
plan skip_all => "Skip \$ENV{SLOW_TESTS} is not set\n";
}
eval { require Proc::ProcessTable; };
EVAL { require Proc::ProcessTable; };
if ($@) {
plan skip_all => "Skip Proc::ProcessTable not installed \n";
}
eval { require Storable };
EVAL { require Storable };
$have_storable = $@ ? 0 : 1;
my ($dbh, $sth);
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all =>
Expand Down Expand Up @@ -2093,7 +2093,7 @@ $not_ok = 0;
$prev_size= undef;
for (my $i = 0; $i < $COUNT_CONNECT; $i++) {
eval {$dbh2 = DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh2 = DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
$not_ok++;
Expand Down Expand Up @@ -2246,7 +2246,7 @@ use lib 't', '.';
require 'lib.pl';
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all => "ERROR: $@. Can't continue test";
Expand All @@ -2265,7 +2265,7 @@ EOT
ok $dbh->do($create);
my $sth;
eval {$sth= $dbh->prepare("insert into $table values (?)")};
EVAL {$sth= $dbh->prepare("insert into $table values (?)")};
ok ! $@, "prepare: $@";
Expand All @@ -2281,7 +2281,7 @@ ok $dbh->do("DROP TABLE $table");
ok $dbh->do("create table $table (a int, b double, primary key (a))");
eval { $sth= $dbh->prepare("insert into $table values (?, ?)")};
EVAL { $sth= $dbh->prepare("insert into $table values (?, ?)")};
ok ! $@, "prepare: $@";
Expand Down Expand Up @@ -2322,14 +2322,14 @@ $|= 1;
use vars qw($table $test_dsn $test_user $test_password);
my $drh;
eval {$drh = DBI->install_driver('mysql')};
EVAL {$drh = DBI->install_driver('mysql')};
if ($@) {
plan skip_all => "Can't obtain driver handle ERROR: $@. Can't continue test";
}
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 })};
if ($@) {
Expand Down Expand Up @@ -2443,7 +2443,7 @@ use Test::More;
use vars qw($test_dsn $test_user $test_password);
my $dbh;
eval {$dbh= DBI->connect( $test_dsn, $test_user, $test_password);};
EVAL {$dbh= DBI->connect( $test_dsn, $test_user, $test_password);};
if ($@) {
plan skip_all => "$@. Can't continue test";
}
Expand Down Expand Up @@ -2495,7 +2495,7 @@ require 'lib.pl';
my ($row, $vers, $test_procs);
my $dbh;
eval {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, AutoCommit => 1})};
if ($@) {
Expand Down Expand Up @@ -2549,7 +2549,7 @@ $|= 1;
use vars qw($table $test_dsn $test_user $test_password);
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0,
mysql_multi_statements => 1 });};
Expand Down Expand Up @@ -2622,7 +2622,7 @@ use Carp qw(croak);
use vars qw($table $test_dsn $test_user $test_password);
my ($row, $vers, $test_procs, $dbh, $sth);
eval {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, AutoCommit => 1})};
if ($@) {
Expand Down Expand Up @@ -2753,7 +2753,7 @@ use lib 't', '.';
require 'lib.pl';
my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
EVAL {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0, mysql_init_command => 'SET SESSION wait_timeout=7' });};
if ($@) {
plan skip_all => "ERROR: $DBI::errstr. Can't continue test";
Expand Down Expand Up @@ -2813,7 +2813,7 @@ if (-f ($file = "t/$dbdriver.dbtest") ||
-f ($file = "$dbdriver.dbtest") ||
-f ($file = "../tests/$dbdriver.dbtest") ||
-f ($file = "tests/$dbdriver.dbtest")) {
eval { require $file; };
EVAL { require $file; };
if ($@) {
print STDERR "Cannot execute $file: $@.\n";
print "1..0\n";
Expand All @@ -2827,7 +2827,7 @@ if (-f ($file = "t/$mdriver.mtest") ||
-f ($file = "$mdriver.mtest") ||
-f ($file = "../tests/$mdriver.mtest") ||
-f ($file = "tests/$mdriver.mtest")) {
eval { require $file; };
EVAL { require $file; };
if ($@) {
print STDERR "Cannot execute $file: $@.\n";
print "1..0\n";
Expand Down
4 changes: 2 additions & 2 deletions t/25-mysql-common.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ my %*opts = ().hash;
%*opts<user> = 'moritz';
%*opts<password> = 'aeNohh4a';

# Detect and report possible errors from eval of the common test script
warn $! if "ok 99-common.pl6" ne eval slurp 't/99-common.pl6';
# Detect and report possible errors from EVAL of the common test script
warn $! if "ok 99-common.pl6" ne EVAL slurp 't/99-common.pl6';
4 changes: 2 additions & 2 deletions t/35-Pg-common.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ my $post_connect_cb = {
$dbh.do('SET client_min_messages = warning');
};

# Detect and report possible errors from eval of the common test script
warn $! if "ok 99-common.pl6" ne eval slurp 't/99-common.pl6';
# Detect and report possible errors from EVAL of the common test script
warn $! if "ok 99-common.pl6" ne EVAL slurp 't/99-common.pl6';

=begin pod
Expand Down
4 changes: 2 additions & 2 deletions t/40-sqlite-common.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ my ( $*mdriver, %*opts) = 'SQLite';
%*opts<database> = 'minidbi-test.sqlite3';
my $dbh;

# Detect and report possible errors from eval of the common test script
warn $! if "ok 99-common.pl6" ne eval slurp 't/99-common.pl6';
# Detect and report possible errors from EVAL of the common test script
warn $! if "ok 99-common.pl6" ne EVAL slurp 't/99-common.pl6';
Loading

0 comments on commit 8b39acb

Please sign in to comment.