[Bast-commits] r9200 - in DBIx-Class/0.08/trunk: lib/DBIx/Class t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Apr 24 00:23:05 GMT 2010
Author: ribasushi
Date: 2010-04-24 01:23:05 +0100 (Sat, 24 Apr 2010)
New Revision: 9200
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm
DBIx-Class/0.08/trunk/t/03podcoverage.t
DBIx-Class/0.08/trunk/t/39load_namespaces_1.t
DBIx-Class/0.08/trunk/t/72pg.t
Log:
10% speed up on quoted statement generation
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm 2010-04-23 23:29:00 UTC (rev 9199)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm 2010-04-24 00:23:05 UTC (rev 9200)
@@ -198,7 +198,9 @@
my $rs = ref ($_[0]) || $_[0];
if ($rs->can ('result_source_instance') ) {
- return $rs->result_source_instance;
+ my $x = $rs->result_source_instance;
+ use Data::Dumper;
+ die Dumper $x;
}
else {
$class->throw_exception (
@@ -1316,6 +1318,8 @@
my $orig_source = $source;
$source = $source->new({ %$source, source_name => $moniker });
+ use Data::Dumper;
+ die Dumper $source;
$source->schema($self);
Scalar::Util::weaken($source->{schema}) if ref($self);
Modified: DBIx-Class/0.08/trunk/t/03podcoverage.t
===================================================================
--- DBIx-Class/0.08/trunk/t/03podcoverage.t 2010-04-23 23:29:00 UTC (rev 9199)
+++ DBIx-Class/0.08/trunk/t/03podcoverage.t 2010-04-24 00:23:05 UTC (rev 9200)
@@ -14,8 +14,8 @@
require DBIx::Class;
unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_podcoverage') ) {
my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_podcoverage');
- $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author
- ? die ("Failed to load release-testing module requirements: $missing")
+ DBICTest::AuthorCheck->is_author
+ ? die ("Failed to load author-testing module requirements: $missing")
: plan skip_all => "Test needs: $missing"
}
Modified: DBIx-Class/0.08/trunk/t/39load_namespaces_1.t
===================================================================
--- DBIx-Class/0.08/trunk/t/39load_namespaces_1.t 2010-04-23 23:29:00 UTC (rev 9199)
+++ DBIx-Class/0.08/trunk/t/39load_namespaces_1.t 2010-04-24 00:23:05 UTC (rev 9200)
@@ -3,22 +3,24 @@
use strict;
use warnings;
use Test::More;
+use Test::Warn;
use lib qw(t/lib);
use DBICTest; # do not remove even though it is not used
-my $warnings;
-eval {
- local $SIG{__WARN__} = sub { $warnings .= shift };
+warnings_exist (
+ sub {
package DBICNSTest;
use base qw/DBIx::Class::Schema/;
__PACKAGE__->load_namespaces;
-};
-ok(!$@, 'load_namespaces doesnt die') or diag $@;
-like($warnings, qr/load_namespaces found ResultSet class C with no corresponding Result class/, 'Found warning about extra ResultSet classes');
+ },
+ [
+ qr/load_namespaces found ResultSet class C with no corresponding Result class/,
+ qr/load_namespaces found ResultSet class DBICNSTest::ResultSet::D that does not subclass DBIx::Class::ResultSet/,
+ ],
+ 'Found warning about extra ResultSet classes, and incorrectly subclassed ResultSets',
+);
-like($warnings, qr/load_namespaces found ResultSet class DBICNSTest::ResultSet::D that does not subclass DBIx::Class::ResultSet/, 'Found warning about ResultSets with incorrect subclass');
-
my $source_a = DBICNSTest->source('A');
isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
my $rset_a = DBICNSTest->resultset('A');
Modified: DBIx-Class/0.08/trunk/t/72pg.t
===================================================================
--- DBIx-Class/0.08/trunk/t/72pg.t 2010-04-23 23:29:00 UTC (rev 9199)
+++ DBIx-Class/0.08/trunk/t/72pg.t 2010-04-24 00:23:05 UTC (rev 9200)
@@ -146,7 +146,7 @@
}
SKIP: {
- skip "Need DBD::Pg 2.9.2 or newer for array tests", 4 if $DBD::Pg::VERSION < 2.009002;
+ skip "Need DBD::Pg 2.9.2 or newer for array tests", 5 if $DBD::Pg::VERSION < 2.009002;
lives_ok {
$schema->resultset('ArrayTest')->create({
@@ -160,8 +160,14 @@
});
} 'updating arrayref as pg array data';
+ lives_ok {
+ my $row = $schema->resultset('ArrayTest')->next;
+ $row->arrayfield ([5, 6]);
+ $row->update;
+ } 'updating dirty arrayref as pg array data';
+
$schema->resultset('ArrayTest')->create({
- arrayfield => [5, 6],
+ arrayfield => [7, 8],
});
my $count;
@@ -262,7 +268,12 @@
}
}
+ # make sure subqueried count still works
+ lives_ok ( sub {
+ }, 'for does not propagate on count subqueries');
+
+
######## other older Auto-pk tests
$schema->source("SequenceTest")->name("dbic_t_schema.sequence_test");
More information about the Bast-commits
mailing list