From: Amiri Barksdale Date: Tue, 1 Jun 2010 23:26:37 +0000 (+0000) Subject: Clean up test file. X-Git-Tag: v0.08124~114^2~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aaa03c5db0bf397d83101df061ed247bebb72498;p=dbsrgits%2FDBIx-Class.git Clean up test file. --- diff --git a/t/105view_deps.t b/t/105view_deps.t index 8fcee78..c285c94 100644 --- a/t/105view_deps.t +++ b/t/105view_deps.t @@ -7,12 +7,8 @@ use Test::More; use Test::Exception; use lib qw(t/lib); use ViewDeps; -use Devel::Dwarn; -use Data::Dumper; -use Carp::Always; BEGIN { - #$ENV{DBIC_TRACE} = 1; use_ok('DBIx::Class::ResultSource::View'); } @@ -27,10 +23,6 @@ can_ok( $view, $_ ) for qw/new from deploy_depends_on/; #################### DEPS -#if (-e "t/var/viewdeps.db") { -#ok(unlink("t/var/viewdeps.db"),"Deleted old DB OK"); -#} - my @sql_files = glob("t/sql/ViewDeps*.sql"); for (@sql_files) { ok( unlink($_), "Deleted old SQL $_ OK" ); @@ -51,16 +43,15 @@ my $deps_ref = { } @{ [ $schema->sources ] } }; -#diag( Dwarn $deps_ref); - -my @sorted_sources = sort { - keys %{ $deps_ref->{$a} || {} } <=> keys %{ $deps_ref->{$b} || {} } +my @sorted_sources = + sort { + keys %{ $deps_ref->{$a} || {} } + <=> + keys %{ $deps_ref->{$b} || {} } || $a cmp $b } keys %$deps_ref; -#diag( Dwarn @sorted_sources ); - #################### DEPLOY my $ddl_dir = "t/sql"; @@ -73,18 +64,16 @@ $schema->deploy( { add_drop_table => 1 } ); #################### DOES ORDERING WORK? my $tr = $schema->{sqlt}; -#diag("My TR isa: ", ref $tr); -#diag( Dwarn keys %{$tr->{views}}); -my @keys = keys %{$tr->{views}}; +my @keys = keys %{$tr->{views}}; my @sqlt_sources = -sort { - $tr->{views}->{$a}->{order} cmp $tr->{views}->{$b}->{order} -} -@keys; - -#diag(Dwarn @sqlt_sources); + sort { + $tr->{views}->{$a}->{order} + cmp + $tr->{views}->{$b}->{order} + } + @keys; is_deeply(\@sorted_sources,\@sqlt_sources,"SQLT view order triumphantly matches our order.");