mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 22:28:47 -04:00
DBD-SQLite: added a test against binding weird number param
This commit is contained in:
parent
0c6f7fb3bd
commit
1ce0a42724
1 changed files with 26 additions and 0 deletions
26
t/31_bind_weird_number_param.t
Normal file
26
t/31_bind_weird_number_param.t
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
BEGIN {
|
||||||
|
$| = 1;
|
||||||
|
$^W = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
my @to_be_tested;
|
||||||
|
BEGIN { @to_be_tested = (1.23E4); }
|
||||||
|
|
||||||
|
use Test::More tests => 2 + @to_be_tested;
|
||||||
|
use t::lib::Test;
|
||||||
|
|
||||||
|
my $dbh = connect_ok();
|
||||||
|
|
||||||
|
ok( $dbh->do("CREATE TABLE f (id, num)"), 'CREATE TABLE f' );
|
||||||
|
|
||||||
|
SCOPE: {
|
||||||
|
my $sth = $dbh->prepare("INSERT INTO f VALUES (?, ?)");
|
||||||
|
for(my $id = 0; $id < @to_be_tested; $id++) {
|
||||||
|
$sth->execute($id, $to_be_tested[$id]);
|
||||||
|
my $av = $dbh->selectrow_arrayref("SELECT num FROM f WHERE id = ?", {}, $id);
|
||||||
|
ok( (@$av && $av->[0] == $to_be_tested[$id]), "accepts $to_be_tested[$id]: ".$av->[0]);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue