File: 04_escaping.t

package info (click to toggle)
libpath-class-uri-perl 0.08-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144 kB
  • sloc: perl: 157; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 616 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
use strict;
use Test::Base;

use Path::Class;
use Path::Class::URI;
plan tests => 4 * blocks;

filters 'chomp';

run {
    my $block = shift;

    {
        my $file = file($block->input);
        my $file_back = file_from_uri($file->uri);
        isa_ok $file_back, 'Path::Class::File';
        is $file_back, $file;
    }

    {
        my $dir = dir($block->input);
        my $dir_back = dir_from_uri($dir->uri);
        isa_ok $dir_back, 'Path::Class::Dir';
        is $dir_back, $dir;
    }
};

__END__

===
--- input
/path/to/test/download;jsessionid=ABC.pdf
===
--- input
/a/b;c/d;e
===
--- input
/a/b%c/d%e