X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F749sqlanywhere.t;h=0999f6d46a6732b065897d5fb5f2e6399f39239c;hb=74b5397c077a964ed301d18f5ccda72afa91f353;hp=816186e195f583fc910ba288bc8f4a0b7ed74924;hpb=199fbc453ec03891d0e156d7353c5e992ba4de47;p=dbsrgits%2FDBIx-Class.git diff --git a/t/749sqlanywhere.t b/t/749sqlanywhere.t index 816186e..0999f6d 100644 --- a/t/749sqlanywhere.t +++ b/t/749sqlanywhere.t @@ -23,8 +23,6 @@ plan skip_all => 'Test needs ' . or (not $dsn || $dsn2); -DBICTest::Schema->load_classes('ArtistGUID'); - # tests stolen from 748informix.t plan skip_all => <<'EOF' unless $dsn || $dsn2; @@ -32,6 +30,9 @@ Set $ENV{DBICTEST_SQLANYWHERE_DSN} and/or $ENV{DBICTEST_SQLANYWHERE_ODBC_DSN}, _USER and _PASS to run these tests EOF +require DBICTest::Schema; +DBICTest::Schema->load_classes('ArtistGUID'); + my @info = ( [ $dsn, $user, $pass ], [ $dsn2, $user2, $pass2 ], @@ -48,7 +49,7 @@ foreach my $info (@info) { auto_savepoint => 1 }); - my $guard = Scope::Guard->new(\&cleanup); + my $guard = Scope::Guard->new(sub{ cleanup($schema) }); my $dbh = $schema->storage->dbh; @@ -150,7 +151,9 @@ EOF id INT NOT NULL PRIMARY KEY, bytea INT NULL, blob LONG BINARY NULL, + blob2 LONG BINARY NULL, clob LONG VARCHAR NULL, + clob2 LONG VARCHAR NULL, a_memo INT NULL ) ],{ RaiseError => 1, PrintError => 1 }); @@ -177,7 +180,7 @@ EOF ok($rs->find($id)->$type eq $binstr{$size}, "verified inserted $size $type" ); } } - + my @uuid_types = qw/uniqueidentifier uniqueidentifierstr/; # test uniqueidentifiers (and the cursor_class). @@ -259,6 +262,7 @@ SQL done_testing; sub cleanup { + my $schema = shift; eval { $schema->storage->dbh->do("DROP TABLE $_") } for qw/artist artist_guid bindtype_test/; }