|
Revision 22773, 0.9 kB
(checked in by daisuke, 5 years ago)
|
|
start refactoring test
|
| Line | |
|---|
| 1 | use strict; |
|---|
| 2 | # use utf8; |
|---|
| 3 | use lib "t/lib"; |
|---|
| 4 | use Test::More tests => 15; |
|---|
| 5 | use Test::Data::Visitor::Encode; |
|---|
| 6 | use Encode; |
|---|
| 7 | |
|---|
| 8 | BEGIN |
|---|
| 9 | { |
|---|
| 10 | use_ok("Data::Visitor::Encode"); |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | { |
|---|
| 14 | use utf8; |
|---|
| 15 | |
|---|
| 16 | # hashref |
|---|
| 17 | encode_utf8_ok( { "日本語" => "あいうえお" }, "encode_utf8 on hashref" ); |
|---|
| 18 | |
|---|
| 19 | # arrayref |
|---|
| 20 | encode_utf8_ok( [ "日本語", "あいうえお" ], "encode_utf8 on arrayref" ); |
|---|
| 21 | |
|---|
| 22 | # scalarref |
|---|
| 23 | encode_utf8_ok( \"日本語", "encode_utf8 on scalarref" ); |
|---|
| 24 | |
|---|
| 25 | encode_utf8_ok( bless({ "日本語" => "あいえうお" }, "Hoge"), "encode_utf8 on object" ); |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | { |
|---|
| 29 | # hashref |
|---|
| 30 | decode_utf8_ok( { "日本語" => "あいうえお" }, "decode_utf8 on hashref" ); |
|---|
| 31 | |
|---|
| 32 | # arrayref |
|---|
| 33 | decode_utf8_ok( [ "日本語", "あいうえお" ], "decode_utf8 on arrayref" ); |
|---|
| 34 | |
|---|
| 35 | # scalarref |
|---|
| 36 | decode_utf8_ok( \"日本語", "decode_utf8 on scalarref" ); |
|---|
| 37 | |
|---|
| 38 | decode_utf8_ok( bless({ "日本語" => "あいえうお" }, "Hoge"), "decode_utf8 on object" ); |
|---|
| 39 | } |
|---|
| 40 | |
|---|