File: 01-compat.t

package info (click to toggle)
liburi-escape-xs-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 144 kB
  • ctags: 3
  • sloc: perl: 239; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!perl -w
#
# $Id: 01-compat.t,v 0.2 2009/03/24 14:24:09 dankogai Exp $
#
# Original as URI-1.35/t/escape.t
#

use URI::Escape::XS qw/uri_escape uri_unescape/;
use Test::More tests => 7;

{
use bytes;
is uri_escape("|abc\xE5"),       "%7Cabc%E5", qq{uri_escape("|abc?")};
is  uri_escape("abc", "b-d"), "a%62%63",   qq{uri_escape("abc", "b-d")};
ok !defined(uri_escape(undef)),            qq{uri_escape(undef)};
is uri_unescape("%7Cabc%e5"),  "|abc\xE5"  ,  qq{uri_unescape("%7Cabc%e5")}; ;
is join(":", uri_unescape("%40A%42", "CDE", "F%47H")), '@AB:CDE:FGH',
    qq{uri_unescape("%40A%42", "CDE", "F%47H")};
}
eval { my $escaped = uri_escape("abc" . chr(300)) };
ok !$@, qq{uri_escape("abc".chr(300)) does NOT croak};
is uri_escape(chr(0xFFF)), "%E0%BF%BF", qq{uri_escape(chr(0xFFF))};