X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746sybase.t;h=9e0caaec229cc2f91829f279b6003eaca8f14ba1;hb=84f97107323065f3be493552cd70ae9d976a4f80;hp=59b7178137f054e274f489a7482677bb4721b9d2;hpb=c20a4aa53fcb667f6746c71faa5de819cda7722d;p=dbsrgits%2FDBIx-Class.git diff --git a/t/746sybase.t b/t/746sybase.t index 59b7178..9e0caae 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -11,7 +11,7 @@ use DBIx::Class::Storage::DBI::Sybase::NoBindVars; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/}; -my $TESTS = 52 + 2; +my $TESTS = 48 + 2; if (not ($dsn && $user)) { plan skip_all => @@ -188,7 +188,8 @@ SQL } } -# test insert_bulk using populate. +# test insert_bulk using populate, this should always pass whether or not it +# does anything Sybase specific or not. Just here to aid debugging. lives_ok { $schema->resultset('Artist')->populate([ { @@ -223,47 +224,6 @@ SQL $bulk_rs->delete; -# make sure insert_bulk works a second time on the same connection - lives_ok { - $schema->resultset('Artist')->populate([ - { - name => 'bulk artist 1', - charfield => 'bar', - }, - { - name => 'bulk artist 2', - charfield => 'bar', - }, - { - name => 'bulk artist 3', - charfield => 'bar', - }, - ]); - } 'insert_bulk via populate called a second time'; - - is $bulk_rs->count, 3, - 'correct number inserted via insert_bulk'; - - is ((grep $_->charfield eq 'bar', $bulk_rs->all), 3, - 'column set correctly via insert_bulk'); - - $bulk_rs->delete; - -# test invalid insert_bulk (missing required column) -# -# There should be a rollback, reconnect and the next valid insert_bulk should -# succeed. - throws_ok { - $schema->resultset('Artist')->populate([ - { - charfield => 'foo', - } - ]); - } qr/no value or default|does not allow null/i, -# The second pattern is the error from fallback to regular array insert on -# incompatible charset. - 'insert_bulk with missing required column throws error'; - # now test insert_bulk with IDENTITY_INSERT lives_ok { $schema->resultset('Artist')->populate([