X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746sybase.t;h=cb6849a16018d5b412e63874359763f68d144d88;hb=992a24f640638601acb795c24af493d789368400;hp=b59fe701b7e8e967c1d1f1d4164afc873f46b194;hpb=65d351219882184861384aedac6f251b6797d0d7;p=dbsrgits%2FDBIx-Class.git diff --git a/t/746sybase.t b/t/746sybase.t index b59fe70..cb6849a 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -20,29 +20,6 @@ if (not ($dsn && $user)) { 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'); -# first run the test without the lang variable set -# it is important to do this before module load, hence -# the subprocess before the optdep check -if ($ENV{LANG} and $ENV{LANG} ne 'C') { - my $oldlang = $ENV{LANG}; - local $ENV{LANG} = 'C'; - - pass ("Your lang is set to $oldlang - testing with C first"); - - my @cmd = ($^X, __FILE__); - - # this is cheating, and may even hang here and there (testing on windows passed fine) - # will be replaced with Test::SubExec::Noninteractive in due course - require IPC::Open2; - IPC::Open2::open2(my $out, my $in, @cmd); - while (my $ln = <$out>) { - print " $ln"; - } - - wait; - ok (! $?, "Wstat $? from: @cmd"); -} - my @storage_types = ( 'DBI::Sybase::ASE', 'DBI::Sybase::ASE::NoBindVars', @@ -112,6 +89,7 @@ SQL # test primary key handling my $new = $schema->resultset('Artist')->create({ name => 'foo' }); + like $new->artistid, qr/^\d+\z/, 'Auto-PK returned a number'; ok($new->artistid > 0, "Auto-PK worked"); $seen_id{$new->artistid}++; @@ -358,7 +336,7 @@ SQL # mostly stolen from the blob stuff Nniuq wrote for t/73oracle.t SKIP: { skip 'TEXT/IMAGE support does not work with FreeTDS', 22 - if $schema->storage->using_freetds; + if $schema->storage->_using_freetds; my $dbh = $schema->storage->_dbh; { @@ -382,7 +360,7 @@ SQL my $maxloblen = length $binstr{'large'}; - if (not $schema->storage->using_freetds) { + if (not $schema->storage->_using_freetds) { $dbh->{'LongReadLen'} = $maxloblen * 2; } else { $dbh->do("set textsize ".($maxloblen * 2)); @@ -555,7 +533,7 @@ SQL } # test insert in an outer transaction when there's an active cursor - TODO: { + { local $TODO = 'this should work once we have eager cursors'; # clear state, or we get a deadlock on $row->delete @@ -630,6 +608,28 @@ SQL is $ping_count, 0, 'no pings'; +# if tests passed and did so under a non-C lang - let's rerun the test +if (Test::Builder->new->is_passing and $ENV{LANG} and $ENV{LANG} ne 'C') { + my $oldlang = $ENV{LANG}; + local $ENV{LANG} = 'C'; + + pass ("Your lang is set to $oldlang - retesting with C"); + + local $ENV{PATH}; + my @cmd = map { $_ =~ /(.+)/ } ($^X, __FILE__); + + # this is cheating, and may even hang here and there (testing on windows passed fine) + # will be replaced with Test::SubExec::Noninteractive in due course + require IPC::Open2; + IPC::Open2::open2(my $out, undef, @cmd); + while (my $ln = <$out>) { + print " $ln"; + } + + wait; + ok (! $?, "Wstat $? from: @cmd"); +} + done_testing; # clean up our mess