File: 03_uri_base.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-- 625 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 => 2 * blocks;

filters 'chomp';
filters { input => 'eval' };

run {
    my $block = shift;
    my $f = 'file';
    my $base_path = $block->input;
    my $abs = URI->new_abs($f, $base_path->uri);
    is $abs, $block->expected;

    my $abs_path = file_from_uri($abs);
    is $abs_path, file($block->abs_path);
};

__END__

===
--- input
Path::Class::dir('/path/to');
--- expected
file:///path/to/file
--- abs_path
/path/to/file

===
--- input
Path::Class::file('/path/to/other_file');
--- expected
file:///path/to/file
--- abs_path
/path/to/file