ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MCP/t/00_load.t
Revision: 1.2
Committed: Fri Oct 9 06:18:51 2026 UTC (10 days, 6 hours ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +12 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.2 BEGIN { $| = 1; print "1..5\n"; }
2 root 1.1 END {print "not ok 1\n" unless $loaded;}
3     use AnyEvent::MCP;
4     $loaded = 1;
5     print "ok 1\n";
6 root 1.2
7     my $text = "\x{e4}\x{1f642}";
8     my $bytes = AnyEvent::MCP::utf8enc $text;
9     print $bytes eq "\xc3\xa4\xf0\x9f\x99\x82"
10     ? "ok 2 - encode UTF-8\n" : "not ok 2 - encode UTF-8\n";
11     print AnyEvent::MCP::utf8dec ($bytes) eq $text
12     ? "ok 3 - decode UTF-8\n" : "not ok 3 - decode UTF-8\n";
13     print $text eq "\x{e4}\x{1f642}"
14     ? "ok 4 - source is unchanged\n" : "not ok 4 - source is unchanged\n";
15     eval { AnyEvent::MCP::utf8dec ("\xff") };
16     print $@ ? "ok 5 - reject invalid UTF-8\n" : "not ok 5 - reject invalid UTF-8\n";