From: Peter Rabbitson Date: Mon, 8 Feb 2010 08:31:01 +0000 (+0000) Subject: Extend utf8columns test to trap fixed bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a786c4585f8e11878b20e541aca3a9dc752ce4b9;p=dbsrgits%2FDBIx-Class-Historic.git Extend utf8columns test to trap fixed bug --- diff --git a/lib/DBIx/Class/UTF8Columns.pm b/lib/DBIx/Class/UTF8Columns.pm index b5349a7..d55224b 100644 --- a/lib/DBIx/Class/UTF8Columns.pm +++ b/lib/DBIx/Class/UTF8Columns.pm @@ -2,7 +2,6 @@ package DBIx::Class::UTF8Columns; use strict; use warnings; use base qw/DBIx::Class/; -use utf8; __PACKAGE__->mk_classdata( '_utf8_columns' ); diff --git a/t/85utf8.t b/t/85utf8.t index fbba764..9f1ab0f 100644 --- a/t/85utf8.t +++ b/t/85utf8.t @@ -5,7 +5,6 @@ use Test::More; use Test::Warn; use lib qw(t/lib); use DBICTest; -use utf8; warning_like ( sub { @@ -28,15 +27,16 @@ DBICTest::Schema::CD->load_components('UTF8Columns'); DBICTest::Schema::CD->utf8_columns('title'); Class::C3->reinitialize(); -my $cd = $schema->resultset('CD')->create( { artist => 1, title => 'øni', year => '2048' } ); -my $utf8_char = 'uniuni'; - +my $cd = $schema->resultset('CD')->create( { artist => 1, title => "weird\x{466}stuff", year => '2048' } ); ok( utf8::is_utf8( $cd->title ), 'got title with utf8 flag' ); +ok(! utf8::is_utf8( $cd->{_column_data}{title} ), 'store title without utf8' ); + ok(! utf8::is_utf8( $cd->year ), 'got year without utf8 flag' ); +ok(! utf8::is_utf8( $cd->{_column_data}{year} ), 'store year without utf8' ); -utf8::decode($utf8_char); -$cd->title($utf8_char); +$cd->title('nonunicode'); +ok(! utf8::is_utf8( $cd->title ), 'got title without utf8 flag' ); ok(! utf8::is_utf8( $cd->{_column_data}{title} ), 'store utf8-less chars' );