Remove TODO labels from blocks not using todo_skip() - no test changes
[dbsrgits/DBIx-Class.git] / t / 746sybase.t
index b59fe70..cb6849a 100644 (file)
@@ -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