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