Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

various fixups to t/99-common.pl6

  • Loading branch information...
commit 25f6fa3d0bd3d6004f05032b4584b9e0be2894e3 1 parent b50230b
@cxreg cxreg authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 t/99-common.pl6
View
18 t/99-common.pl6
@@ -15,12 +15,12 @@ $drh_version = $drh.Version;
ok $drh_version > 0, "MiniDBD::$mdriver version $drh_version"; # test 2
# Connect to the data sourcequantity*price AS amount FROM nom
-my $dbh = MiniDBI.connect( $test_dsn, $test_user, $test_password );
+my $dbh = MiniDBI.connect( $test_dsn, $test_user, $test_password, :RaiseError<1> );
ok $dbh, "connect to $test_dsn"; # test 3
# Test .prepare() and .execute() a few times while setting things up.
# Drop a table of the same name so that the following create can work.
-my $sth = $dbh.prepare("DROP TABLE nom");
+my $sth = $dbh.prepare("DROP TABLE IF EXISTS nom");
my $rc = $sth.execute();
isnt $rc, Bool::True, "drop table gave an expected error " ~
"(did a previous test not clean up?)"; # test 4
@@ -28,14 +28,14 @@ isnt $rc, Bool::True, "drop table gave an expected error " ~
# Create a table
$sth = $dbh.prepare( "
CREATE TABLE nom (
- name char(4),
- description char(30),
- quantity int,
- price numeric(5,2)
+ name varchar(4),
+ description varchar(30),
+ quantity int,
+ price numeric(5,2)
)
");
$rc = $sth.execute();
-is $rc, Bool::True, "do: create table nom"; # test 5
+is $rc, '0E0', "do: create table nom"; # test 5
if 'err' eq any($dbh.^methods) {
is $dbh.err, 0, 'err after successful create should be 0'; # test 6
}
@@ -44,7 +44,7 @@ is $dbh.errstr, Any, "errstr after successful create should be Any"; # test 7
# Insert rows using the various method calls
ok $dbh.do( "
- INSERT nom (name, description, quantity, price)
+ INSERT INTO nom (name, description, quantity, price)
VALUES ( 'BUBH', 'Hot beef burrito', 1, 4.95 )
"), "insert without parameters called from do"; # test 8
@@ -54,7 +54,7 @@ if 'rows' eq any($dbh.^methods) {
else { skip 1, '$dbh.rows not implemented' }
ok $sth = $dbh.prepare( "
- INSERT nom (name, description, quantity, price)
+ INSERT INTO nom (name, description, quantity, price)
VALUES ( ?, ?, ?, ? )
"), "prepare an insert command with parameters"; # test 10
Please sign in to comment.
Something went wrong with that request. Please try again.