From: Peter Rabbitson Date: Wed, 26 Dec 2012 10:31:00 +0000 (+0100) Subject: Remove TODO labels from blocks not using todo_skip() - no test changes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ca1fd6fb90a85f5138d11f580394025aa20ea4a;p=dbsrgits%2FDBIx-Class-Historic.git Remove TODO labels from blocks not using todo_skip() - no test changes --- diff --git a/t/71mysql.t b/t/71mysql.t index 4e89d9f..de1e2fd 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -425,7 +425,7 @@ ZEROINSEARCH: { # kill our $dbh $schema_autorecon->storage->_dbh(undef); - TODO: { + { local $TODO = "Perl $] is known to leak like a sieve" if DBIx::Class::_ENV_::PEEPEENESS; @@ -449,7 +449,7 @@ ZEROINSEARCH: { # try to do something dbic-esque $rs->create({ name => "Hardcore Forker $$" }); - TODO: { + { local $TODO = "Perl $] is known to leak like a sieve" if DBIx::Class::_ENV_::PEEPEENESS; diff --git a/t/72pg.t b/t/72pg.t index 5e4ec84..44b723c 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -287,7 +287,7 @@ for my $use_insert_returning ($test_server_supports_insert_returning } 'find by arrayref (equal)'; # test inferred condition for creation - TODO: for my $cond ( + for my $cond ( { -value => [3,4] }, \[ '= ?' => [arrayfield => [3, 4]] ], ) { diff --git a/t/73oracle.t b/t/73oracle.t index 16e3f63..fc324c5 100644 --- a/t/73oracle.t +++ b/t/73oracle.t @@ -479,7 +479,7 @@ sub _run_tests { # http://download.oracle.com/docs/cd/A87860_01/doc/server.817/a76961/ch294.htm#993 # Oracle Database Reference 10g Release 2 (10.2) # http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2107.htm#sthref1297 - local $TODO = "On Oracle8i all_triggers view is empty, i don't yet know why..." + todo_skip "On Oracle8i all_triggers view is empty, i don't yet know why...", 1 if $schema->storage->_server_info->{normalized_dbms_version} < 9; my $schema2 = $schema->connect($dsn2, $user2, $pass2, $opt); diff --git a/t/73oracle_blob.t b/t/73oracle_blob.t index 3965ea3..ae5a359 100644 --- a/t/73oracle_blob.t +++ b/t/73oracle_blob.t @@ -56,7 +56,6 @@ for my $opt (@tryopt) { sub _run_blob_tests { SKIP: { -TODO: { my ($schema, $opt) = @_; my %binstr = ( 'small' => join('', map { chr($_) } ( 1 .. 127 )) ); $binstr{'large'} = $binstr{'small'} x 1024; @@ -107,7 +106,7 @@ TODO: { ok (try { $objs[0]->blob }||'' eq "blob:$str", 'blob inserted/retrieved correctly'); ok (try { $objs[0]->clob }||'' eq "clob:$str", 'clob inserted/retrieved correctly'); - TODO: { + { local $TODO = '-like comparison on blobs not tested before ora 10 (fails on 8i)' if $schema->storage->_server_info->{normalized_dbms_version} < 10; @@ -157,7 +156,7 @@ TODO: { } $schema->storage->debug ($orig_debug); -}} +} do_clean ($dbh); } diff --git a/t/745db2.t b/t/745db2.t index 12e7045..9123330 100644 --- a/t/745db2.t +++ b/t/745db2.t @@ -90,7 +90,7 @@ is( $lim->count, 2, 'ROWS+OFFSET count ok' ); is( $lim->all, 2, 'Number of ->all objects matches count' ); # Limit with select-lock -TODO: { +{ local $TODO = "Seems we can't SELECT ... FOR ... on subqueries"; lives_ok { $schema->txn_do (sub { diff --git a/t/746mssql.t b/t/746mssql.t index c494be8..b822138 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -251,7 +251,7 @@ SQL my $test_type = "Dialect:$dialect Quoted:$quoted"; # basic limit support - TODO: { + { my $art_rs = $schema->resultset ('Artist'); $art_rs->delete; $art_rs->create({ name => 'Artist ' . $_ }) for (1..6); @@ -398,7 +398,7 @@ SQL is ($owners->page(1)->count, 3, "$test_type: has-many prefetch returns correct count"); is ($owners->page(3)->count, 2, "$test_type: has-many prefetch returns correct count"); - TODO: { + { local $TODO = "Top-limit does not work when your limit ends up past the resultset" if $dialect eq 'Top'; is ($owners->page(3)->all, 2, "$test_type: has_many prefetch returns correct number of rows"); @@ -452,7 +452,7 @@ SQL is ($books->page(1)->count, 2, "$test_type: Prefetched grouped search returns correct count"); is ($books->page(2)->count, 1, "$test_type: Prefetched grouped search returns correct count"); - TODO: { + { local $TODO = "Top-limit does not work when your limit ends up past the resultset" if $dialect eq 'Top'; is ($books->page(2)->all, 1, "$test_type: Prefetched grouped search returns correct number of rows"); @@ -522,7 +522,7 @@ CREATE TABLE money_test ( SQL }); - TODO: { + { my $freetds_and_dynamic_cursors = 1 if $opts_name eq 'use_dynamic_cursors' && $schema->storage->_using_freetds; diff --git a/t/746sybase.t b/t/746sybase.t index abf6551..cb6849a 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -533,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 diff --git a/t/85utf8.t b/t/85utf8.t index af6dedf..ea630a2 100644 --- a/t/85utf8.t +++ b/t/85utf8.t @@ -110,7 +110,7 @@ $storage->debug ($orig_debug); # bind values are always alphabetically ordered by column, thus [1] # the single quotes are an artefact of the debug-system -TODO: { +{ local $TODO = "This has been broken since rev 1191, Mar 2006"; is ($bind[1], "'$bytestream_title'", 'INSERT: raw bytes sent to the database'); } @@ -174,7 +174,7 @@ $cd->update ({ title => $utf8_title }); $cd->title('something_else'); ok( $cd->is_column_changed('title'), 'column is dirty after setting to something completely different'); -TODO: { +{ local $TODO = 'There is currently no way to propagate aliases to inflate_result()'; $cd = $schema->resultset('CD')->find ({ title => $utf8_title }, { select => 'title', as => 'name' }); ok (utf8::is_utf8( $cd->get_column ('name') ), 'utf8 flag propagates via as'); diff --git a/t/delete/related.t b/t/delete/related.t index f8e1d97..d4dc26b 100644 --- a/t/delete/related.t +++ b/t/delete/related.t @@ -52,7 +52,7 @@ is ($cdrs->count, $total_cds -= 2, 'related + condition delete ok'); $a2_cds->search ({}, { rows => 1})->delete; is ($cdrs->count, $total_cds -= 1, 'related + limit delete ok'); -TODO: { +{ local $TODO = 'delete_related is based on search_related which is based on search which does not understand object arguments'; local $SIG{__WARN__} = sub {}; # trap the non-numeric warning, remove when the TODO is removed diff --git a/t/inflate/datetime.t b/t/inflate/datetime.t index 14a2ce0..33be522 100644 --- a/t/inflate/datetime.t +++ b/t/inflate/datetime.t @@ -42,7 +42,7 @@ warnings_exist { } [$dt_warn_re], 'using a DateTime object in ->search generates a warning'; -TODO: { +{ local $TODO = "We can't do this yet before 0.09" if DBIx::Class->VERSION < 0.09; is(eval { $row->id }, 1, 'DT in search'); diff --git a/t/inflate/datetime_oracle.t b/t/inflate/datetime_oracle.t index 2a9b0c3..26a5357 100644 --- a/t/inflate/datetime_oracle.t +++ b/t/inflate/datetime_oracle.t @@ -48,9 +48,10 @@ eval { }; $dbh->do("CREATE TABLE track (trackid NUMBER(12), cd NUMBER(12), position NUMBER(12), title VARCHAR(255), last_updated_on DATE, last_updated_at $timestamp_datatype)"); -TODO: { +# TODO is in effect for the rest of the tests local $TODO = 'FIXME - something odd is going on with Oracle < 9 datetime support' if ($schema->storage->_server_info->{normalized_dbms_version}||0) < 9; + lives_ok { # insert a row to play with @@ -103,7 +104,7 @@ is( $track->last_updated_at, $timestamp, 'DateTime round-trip as TIMESTAMP' ); is( int $track->last_updated_at->nanosecond, int 500_000_000, 'TIMESTAMP nanoseconds survived' ); -} 'dateteime operations executed correctly' } # end of lives_ok/TODO block +} 'dateteime operations executed correctly'; done_testing; diff --git a/t/inflate/file_column.t b/t/inflate/file_column.t index e200619..1b69e51 100644 --- a/t/inflate/file_column.t +++ b/t/inflate/file_column.t @@ -88,7 +88,7 @@ $fh = $new_source_file->open('r') or die "failed to open $new_source_file: $!\n" $fc->file({ handle => $fh, filename => $new_fname }); $fc->update; -TODO: { +{ local $TODO = 'design change required'; ok ( ! -e $storage, 'old storage does not exist' ); }; @@ -120,8 +120,8 @@ $storage = file( $fc->file->{filename}, ); -TODO: { +{ local $TODO = 'need resultset delete override to delete_all'; $rs->delete; ok ( ! -e $storage, 'storage does not exist after $rs->delete' ); -}; +} diff --git a/t/prefetch/count.t b/t/prefetch/count.t index ef2f88b..4311e80 100644 --- a/t/prefetch/count.t +++ b/t/prefetch/count.t @@ -78,7 +78,7 @@ is_same_sql_bind ( ); -TODO: { +{ local $TODO = "Chaining with prefetch is fundamentally broken"; my $queries; diff --git a/t/prefetch/via_search_related.t b/t/prefetch/via_search_related.t index d838ad1..79826ba 100644 --- a/t/prefetch/via_search_related.t +++ b/t/prefetch/via_search_related.t @@ -128,7 +128,6 @@ lives_ok (sub { is($rs->all, 1, 'distinct with prefetch (objects)'); is($rs->count, 1, 'distinct with prefetch (count)'); - TODO: { $queries = 0; $schema->storage->debugcb ($debugcb); $schema->storage->debug (1); @@ -137,13 +136,13 @@ lives_ok (sub { is($rs->search_related('cds')->all, 2, 'prefetched distinct with prefetch (objects)'); is($rs->search_related('cds')->count, 2, 'prefetched distinct with prefetch (count)'); - local $TODO = "This makes another 2 trips to the database, it can't be right"; - is ($queries, 0, 'No extra queries fired (prefetch survives search_related)'); + { + local $TODO = "This makes another 2 trips to the database, it can't be right"; + is ($queries, 0, 'No extra queries fired (prefetch survives search_related)'); + } $schema->storage->debugcb (undef); $schema->storage->debug ($orig_debug); - } - }, 'distinct generally works with prefetch on deep search_related chains'); done_testing; diff --git a/t/relationship/core.t b/t/relationship/core.t index 4f9cff0..96c5066 100644 --- a/t/relationship/core.t +++ b/t/relationship/core.t @@ -40,7 +40,7 @@ if ($INC{'DBICTest/HelperRels.pm'}) { year => 2005, } ); - TODO: { + { local $TODO = "Can't fix right now" if $DBIx::Class::VERSION < 0.09; lives_ok { $big_flop->genre} "Don't throw exception when col is not loaded after insert"; }; @@ -153,7 +153,7 @@ lives_ok( ); -TODO: { +{ local $TODO = "relationship checking needs fixing"; # try to add a bogus relationship using the wrong cols throws_ok { diff --git a/t/resultset/bind_attr.t b/t/resultset/bind_attr.t index af97020..3d8d1cd 100644 --- a/t/resultset/bind_attr.t +++ b/t/resultset/bind_attr.t @@ -16,7 +16,7 @@ my $where_bind = { my $rs; -TODO: { +{ local $TODO = 'bind args order needs fixing (semifor)'; # First, the simple cases... @@ -36,6 +36,14 @@ TODO: { ->search({}, $where_bind); is ( $rs->count, 1, 'where/bind last' ); + + # and the complex case + local $TODO = 'bind args order needs fixing (semifor)'; + $rs = $schema->resultset('CustomSql')->search({}, { bind => [ 1999 ] }) + ->search({ 'artistid' => 1 }, { + where => \'title like ?', + bind => [ 'Spoon%' ] }); + is ( $rs->count, 1, '...cookbook + chained search with extra bind' ); } { @@ -107,13 +115,4 @@ TODO: { ); } -TODO: { - local $TODO = 'bind args order needs fixing (semifor)'; - $rs = $schema->resultset('Complex')->search({}, { bind => [ 1999 ] }) - ->search({ 'artistid' => 1 }, { - where => \'title like ?', - bind => [ 'Spoon%' ] }); - is ( $rs->count, 1, '...cookbook + chained search with extra bind' ); -} - done_testing; diff --git a/t/resultset/plus_select.t b/t/resultset/plus_select.t index 0d3be3c..4f082f5 100644 --- a/t/resultset/plus_select.t +++ b/t/resultset/plus_select.t @@ -20,7 +20,7 @@ my %basecols = $cd_rs->first->get_columns; # ramifications of changing this. Thus the value override and the # TODO to go with it. Delete all of this if ever resolved. my %todo_rel_inflation_override = ( artist => $basecols{artist} ); -TODO: { +{ local $TODO = 'Treating relationships as inflatable data is wrong - see comment in ' . __FILE__; ok (! keys %todo_rel_inflation_override); } diff --git a/t/row/inflate_result.t b/t/row/inflate_result.t index 3ab2271..3327b70 100644 --- a/t/row/inflate_result.t +++ b/t/row/inflate_result.t @@ -86,13 +86,14 @@ ok( ) ); -TODO: { - my $user = $schema->resultset('User')->create($user_data); - my $admin = $schema->resultset('User')->create($admin_data); +{ + my $user = $schema->resultset('User')->create($user_data); + my $admin = $schema->resultset('User')->create($admin_data); - is( ref $user, 'My::Schema::Result::User' ); - local $TODO = 'New objects should also be inflated'; - is( ref $admin, 'My::Schema::Result::User::Admin' ); + is( ref $user, 'My::Schema::Result::User' ); + + local $TODO = 'New objects should also be inflated'; + is( ref $admin, 'My::Schema::Result::User::Admin' ); } my $user = $schema->resultset('User')->single($user_data); diff --git a/t/sqlmaker/order_by_bindtransport.t b/t/sqlmaker/order_by_bindtransport.t index d2a4e83..b612375 100644 --- a/t/sqlmaker/order_by_bindtransport.t +++ b/t/sqlmaker/order_by_bindtransport.t @@ -9,8 +9,6 @@ use DBICTest; use DBIC::SqlMakerTest; sub test_order { - - TODO: { my $rs = shift; my $args = shift; @@ -46,7 +44,6 @@ sub test_order { ], ) || diag Dumper $args->{order_by}; }; - } } my @tests = ( diff --git a/t/storage/deploy.t b/t/storage/deploy.t index 444bf26..233da2c 100644 --- a/t/storage/deploy.t +++ b/t/storage/deploy.t @@ -35,9 +35,9 @@ $schema->create_ddl_dir( undef, undef, $test_dir_1 ); ok( -d $test_dir_1, 'create_ddl_dir did a make_path on its target dir' ); ok( scalar( glob $test_dir_1.'/*.sql' ), 'there are sql files in there' ); -TODO: { - local $TODO = 'we should probably add some tests here for actual deployability of the DDL?'; - ok( 0 ); +{ + local $TODO = 'we should probably add some tests here for actual deployability of the DDL?'; + ok( 0 ); } END {