From: Rafael Kitover Date: Sat, 12 Jun 2010 08:47:28 +0000 (-0400) Subject: add proper test for column names with punctuation, bump CAG dep for fix X-Git-Tag: v0.08124~106 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=7653fdac491d081ed2915462ed46c7c415bc9b65 add proper test for column names with punctuation, bump CAG dep for fix --- diff --git a/Changes b/Changes index e5d5b23..d33253b 100644 --- a/Changes +++ b/Changes @@ -16,6 +16,8 @@ Revision history for DBIx::Class failures - Fixed distinct with order_by to not double-specify the same column in the GROUP BY clause + - Properly support column names with symbols (e.g. single quote) + via custom accessors * Misc - Refactored capability handling in Storage::DBI, allows for diff --git a/Makefile.PL b/Makefile.PL index c63a12a..8443be8 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -48,7 +48,7 @@ my $test_requires = { my $runtime_requires = { 'Carp::Clan' => '6.0', - 'Class::Accessor::Grouped' => '0.09003', + 'Class::Accessor::Grouped' => '0.09004', 'Class::C3::Componentised' => '1.0005', 'Class::Inspector' => '1.24', 'Data::Page' => '2.00', diff --git a/t/63register_column.t b/t/63register_column.t new file mode 100644 index 0000000..49d37bb --- /dev/null +++ b/t/63register_column.t @@ -0,0 +1,13 @@ +use strict; +use warnings; + +use Test::More; +use Test::Exception; +use lib qw(t/lib); +use DBICTest; + +lives_ok { + DBICTest::Schema->load_classes('PunctuatedColumnName') +} 'registered columns with weird names'; + +done_testing; diff --git a/t/lib/DBICTest/Schema/PunctuatedColumnName.pm b/t/lib/DBICTest/Schema/PunctuatedColumnName.pm new file mode 100644 index 0000000..7d48f87 --- /dev/null +++ b/t/lib/DBICTest/Schema/PunctuatedColumnName.pm @@ -0,0 +1,31 @@ +package # hide from PAUSE + DBICTest::Schema::PunctuatedColumnName; + +use base qw/DBICTest::BaseResult/; + +__PACKAGE__->table('punctuated_column_name'); +__PACKAGE__->add_columns( + 'id' => { + data_type => 'integer', + is_auto_increment => 1, + }, + q{foo ' bar} => { + data_type => 'integer', + is_nullable => 1, + accessor => 'foo_bar', + }, + q{bar/baz} => { + data_type => 'integer', + is_nullable => 1, + accessor => 'bar_baz', + }, + q{baz;quux} => { + data_type => 'integer', + is_nullable => 1, + accessor => 'bar_quux', + }, +); + +__PACKAGE__->set_primary_key('id'); + +1;