fixed up sqlt tests a bit and tried fixing 2 failing sqlt tests
[dbsrgits/DBIx-Class-Historic.git] / t / 85utf8.t
CommitLineData
70350518 1use strict;
2use warnings;
e59c17fe 3
70350518 4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
e59c17fe 7
a47e1233 8my $schema = DBICTest->init_schema();
e59c17fe 9
70350518 10eval 'use Encode ; 1'
11 or plan skip_all => 'Install Encode run this test';
e59c17fe 12
70350518 13plan tests => 2;
e59c17fe 14
70350518 15DBICTest::Schema::Artist->load_components('UTF8Columns');
16DBICTest::Schema::Artist->utf8_columns('name');
17Class::C3->reinitialize();
18
19my $artist = $schema->resultset("Artist")->create( { name => 'uni' } );
20ok( Encode::is_utf8( $artist->name ), 'got name with utf8 flag' );
21
22my $utf8_char = 'uniuni';
23Encode::_utf8_on($utf8_char);
24$artist->name($utf8_char);
25ok( !Encode::is_utf8( $artist->{_column_data}->{name} ),
26 'store utf8 less chars' );
e59c17fe 27