X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746sybase.t;h=7fcffb4fd44e56ae6913409b9e59d168f8872fd0;hb=6edb8b2f7c2fa0b7ce4ed80ea99ec2f830f3244c;hp=441a25816f2465b56cedd3cd820cb580efc5bd90;hpb=6469dabf60e2e7f7ca05122ec8bd4497e07bab2f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/746sybase.t b/t/746sybase.t index 441a258..7fcffb4 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -1,12 +1,16 @@ use strict; -use warnings; +use warnings; no warnings 'uninitialized'; use Test::More; use Test::Exception; +use DBIx::Class::Optional::Dependencies (); use lib qw(t/lib); use DBICTest; +plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_ase') + unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_ase'); + my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/}; my $TESTS = 66 + 2; @@ -346,10 +350,11 @@ SQL $dbh->do(qq[ CREATE TABLE bindtype_test ( - id INT IDENTITY PRIMARY KEY, - bytea IMAGE NULL, - blob IMAGE NULL, - clob TEXT NULL + id INT IDENTITY PRIMARY KEY, + bytea IMAGE NULL, + blob IMAGE NULL, + clob TEXT NULL, + a_memo IMAGE NULL ) ],{ RaiseError => 1, PrintError => 0 }); } @@ -438,12 +443,10 @@ SQL lives_ok { $rs->populate([ { - bytea => 1, blob => $binstr{large}, clob => $new_str, }, { - bytea => 1, blob => $binstr{large}, clob => $new_str, }, @@ -471,12 +474,14 @@ SQL bytea => 1, blob => $binstr{large}, clob => $new_str, + a_memo => 2, }, { id => 2, bytea => 1, blob => $binstr{large}, clob => $new_str, + a_memo => 2, }, ]); } 'insert_bulk with blobs and explicit identity does NOT die'; @@ -556,25 +561,24 @@ SQL $row = $rs->create({ amount => 100 }); } 'inserted a money value'; - is eval { $rs->find($row->id)->amount }, 100, 'money value round-trip'; + cmp_ok eval { $rs->find($row->id)->amount }, '==', 100, + 'money value round-trip'; lives_ok { $row->update({ amount => 200 }); } 'updated a money value'; - is eval { $rs->find($row->id)->amount }, - 200, 'updated money value round-trip'; + cmp_ok eval { $rs->find($row->id)->amount }, '==', 200, + 'updated money value round-trip'; lives_ok { $row->update({ amount => undef }); } 'updated a money value to NULL'; - my $null_amount = eval { $rs->find($row->id)->amount }; - ok( - (($null_amount == undef) && (not $@)), - 'updated money value to NULL round-trip' - ); - diag $@ if $@; + lives_and { + my $null_amount = $rs->find($row->id)->amount; + is $null_amount, undef; + } 'updated money value to NULL round-trip'; # Test computed columns and timestamps $schema->storage->dbh_do (sub {