/[suikacvs]/messaging/manakai/t/encode-transfer-nonascii.t
Suika

Contents of /messaging/manakai/t/encode-transfer-nonascii.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download) (as text)
Sun Nov 16 01:55:48 2003 UTC (21 years ago) by wakaba
Branch: MAIN
CVS Tags: before-dis2-200411, manakai-release-0-3-2, manakai-release-0-3-1, manakai-release-0-4-0, manakai-200612, HEAD
Branch point for: experimental-xml-parser-200401
File MIME type: application/x-troff
Imported to CVS

1 wakaba 1.1 #!/usr/bin/perl -w
2     ## -*- euc-japan -*-
3     use strict;
4    
5     use Test;
6     require Message::Util;
7    
8     my (%test);
9    
10     %test = (
11     "(180)(193)(187)(250)(161)(162)(165)(171)(165)(191)(165)(171)(165)(202)(161)(162)(164)(210)(164)(233)(164)(172)(164)(202)"
12     => ['decoding 8bit printable-string' => sub { Message::Util::encode_printable_string (
13     "漢字、カタカナ、ひらがな"
14     ) }],
15     "'a demo.'"
16     => ['decoding no-encoded printable-string' => sub { Message::Util::decode_printable_string (
17     "'a demo.'"
18     ) }],
19     "a demo."
20     => ['encoding printable-string' => sub { Message::Util::encode_printable_string (
21     "a demo."
22     ) }],
23     q{foo(a)bar.example}
24     => ['encoding printable-string' => sub { Message::Util::encode_printable_string (
25     q{foo@bar.example}
26     ) }],
27     q{foo@bar.example}
28     => ['decoding printable-string' => sub { Message::Util::decode_printable_string (
29     q{foo(A)bar.example}
30     ) }],
31     q{(q)(u)(p)(q)(126)}
32     => ['encoding printable-string' => sub { Message::Util::encode_printable_string (
33     q{"_%"~}
34     ) }],
35     q{"_%"(}
36     => ['decoding printable-string' => sub { Message::Util::decode_printable_string (
37     q{(q)(u)(p)(q)(}
38     ) }],
39     q{aou(vvv)v{dfda}ddd}
40     => ['decoding T.61String' => sub { Message::Util::decode_t61_string (
41     q{aou{040}vvv{041}v{123}dfda{125}ddd}
42     ) }],
43     q{Aidfo{064}bar.example}
44     => ['encoding T.61String' => sub { Message::Util::encode_t61_string (
45     q{Aidfo@bar.example}
46     ) }],
47     q{dd(d)v)(%)aaieu}
48     => ['decoding T.61String' => sub { Message::Util::decode_t61_string (
49     q{dd{040}d{041}v{041040037041}aaieu}
50     ) }],
51     q{argle#~}
52     => ['decoding restricted RFC 822' => sub { Message::Util::decode_restricted_rfc822 (
53     q{argle#h##126#}
54     ) }],
55     q{Steve_Kille}
56     => ['encoding restricted RFC 822' => sub { Message::Util::encode_restricted_rfc822 (
57     q{Steve Kille}
58     ) }],
59     );
60     plan tests => 0 + keys (%test);
61    
62     for (keys %test) {
63     ok (&{ $test{$_}->[1] }, $_, $test{$_}->[0].' is broken');
64     }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24