File: escape-char.t

package info (click to toggle)
liburi-perl 1.64-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 608 kB
  • ctags: 303
  • sloc: perl: 4,914; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 610 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
25
26
27
28
29
use strict;
use warnings;

# see https://rt.cpan.org/Ticket/Display.html?id=96941

use Test::More;
use URI;

TODO: {
    my $str = "http://foo/\xE9";
    utf8::upgrade($str);
    my $uri = URI->new($str);

    local $TODO = 'URI::Escape::escape_char misunderstands utf8';

    # http://foo/%C3%A9
    is("$uri", 'http://foo/%E9', 'correctly created a URI from a utf8-upgraded string');
}

{
    my $str = "http://foo/\xE9";
    utf8::downgrade($str);
    my $uri = URI->new($str);

    # http://foo/%E9
    is("$uri", 'http://foo/%E9', 'correctly created a URI from a utf8-downgrade string');
}

done_testing;