summaryrefslogtreecommitdiff
path: root/t/31_bind_weird_number_param.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2012-09-24 10:15:50 +0000
committerLorry <lorry@roadtrain.codethink.co.uk>2012-09-26 13:46:46 +0000
commit485b97be9f2f2abf5a40923b5fd85f75714a8c02 (patch)
treeca05cb0ecf3828d909a898c3e5805804a0aff5f8 /t/31_bind_weird_number_param.t
downloadperl-dbd-sqlite-tarball-485b97be9f2f2abf5a40923b5fd85f75714a8c02.tar.gz
Imported from /srv/lorry/lorry-area/perl-dbd-sqlite-tarball/DBD-SQLite-1.38_01.tar.gz.HEADDBD-SQLite-1.38_01masterbaserock/morph
Diffstat (limited to 't/31_bind_weird_number_param.t')
-rw-r--r--t/31_bind_weird_number_param.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/31_bind_weird_number_param.t b/t/31_bind_weird_number_param.t
new file mode 100644
index 0000000..888773a
--- /dev/null
+++ b/t/31_bind_weird_number_param.t
@@ -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]);
+ }
+}