X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Storage.git;a=blobdiff_plain;f=t%2F104_io_w_utf8.t;fp=t%2F104_io_w_utf8.t;h=b7e9ea7b6e2591ee07978ee591b0e9d05e8f434e;hp=6cc5ec5f75c12c239964a9825f6f510f8ed2233d;hb=766ab81f59db9f3087e0011112ff2e69133a85c5;hpb=11d44bb52ca8164d34774985af7b550cfd0c60a0 diff --git a/t/104_io_w_utf8.t b/t/104_io_w_utf8.t index 6cc5ec5..b7e9ea7 100644 --- a/t/104_io_w_utf8.t +++ b/t/104_io_w_utf8.t @@ -8,18 +8,18 @@ use File::Temp qw(tempdir); use File::Spec::Functions; my $dir = tempdir( CLEANUP => 1 ); -BEGIN { +BEGIN { eval "use JSON::Any"; - plan skip_all => "JSON::Any is required for this test" if $@; - # NOTE: - # this is because JSON::XS is + plan skip_all => "JSON::Any is required for this test" if $@; + # NOTE: + # this is because JSON::XS is # the only one which really gets # utf8 correct - # - SL - BEGIN { + # - SL + BEGIN { $ENV{JSON_ANY_ORDER} = qw(XS); - $ENV{JSON_ANY_CONFIG} = "utf8=1"; - } + $ENV{JSON_ANY_CONFIG} = "utf8=1"; + } plan tests => 8; use_ok('MooseX::Storage'); } @@ -32,7 +32,7 @@ use utf8; use MooseX::Storage; with Storage( 'format' => 'JSON', 'io' => 'File' ); - + has 'utf8_string' => ( is => 'rw', isa => 'Str', @@ -45,16 +45,16 @@ my $file = catfile($dir,'temp.json'); { my $foo = Foo->new; isa_ok( $foo, 'Foo' ); - - $foo->store($file); + + $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); - is($foo->utf8_string, - "ネットスーパー (Internet Shopping)", + is($foo->utf8_string, + "ネットスーパー (Internet Shopping)", '... got the string we expected'); } @@ -67,18 +67,18 @@ unlink $file; utf8_string => 'Escritório' ); isa_ok( $foo, 'Foo' ); - - $foo->store($file); + + $foo->store($file); } { my $foo = Foo->load($file); isa_ok($foo, 'Foo'); - + ok(utf8::is_utf8($foo->utf8_string), '... the string is still utf8'); - is($foo->utf8_string, - "Escritório", + is($foo->utf8_string, + "Escritório", '... got the string we expected'); }