ACIL FM
Dark
Refresh
Current DIR:
/home/.cpan/build/Path-Tiny-0.146-0/t
/
home
.cpan
build
Path-Tiny-0.146-0
t
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
data
-
chmod
Open
Rename
Delete
fakelib
-
chmod
Open
Rename
Delete
lib
-
chmod
Open
Rename
Delete
00-report-prereqs.dd
4.52 MB
chmod
View
DL
Edit
Rename
Delete
00-report-prereqs.t
5.88 MB
chmod
View
DL
Edit
Rename
Delete
basename.t
880 B
chmod
View
DL
Edit
Rename
Delete
basic.t
9.06 MB
chmod
View
DL
Edit
Rename
Delete
children.t
1.24 MB
chmod
View
DL
Edit
Rename
Delete
chmod.t
1020 B
chmod
View
DL
Edit
Rename
Delete
digest.t
1.25 MB
chmod
View
DL
Edit
Rename
Delete
exception.t
1.26 MB
chmod
View
DL
Edit
Rename
Delete
exports.t
674 B
chmod
View
DL
Edit
Rename
Delete
filesystem.t
13.82 MB
chmod
View
DL
Edit
Rename
Delete
has_same_bytes.t
2.04 MB
chmod
View
DL
Edit
Rename
Delete
input_output.t
18.31 MB
chmod
View
DL
Edit
Rename
Delete
input_output_no_PU_UU.t
579 B
chmod
View
DL
Edit
Rename
Delete
input_output_no_UU.t
566 B
chmod
View
DL
Edit
Rename
Delete
locking.t
1.37 MB
chmod
View
DL
Edit
Rename
Delete
mkdir.t
1008 B
chmod
View
DL
Edit
Rename
Delete
mkpath.t
947 B
chmod
View
DL
Edit
Rename
Delete
mutable_tree_while_iterating.t
1.43 MB
chmod
View
DL
Edit
Rename
Delete
normalize.t
898 B
chmod
View
DL
Edit
Rename
Delete
overloading.t
534 B
chmod
View
DL
Edit
Rename
Delete
parent.t
3.06 MB
chmod
View
DL
Edit
Rename
Delete
README
214 B
chmod
View
DL
Edit
Rename
Delete
recurse.t
3.89 MB
chmod
View
DL
Edit
Rename
Delete
rel-abs.t
7.88 MB
chmod
View
DL
Edit
Rename
Delete
sig_die.t
533 B
chmod
View
DL
Edit
Rename
Delete
size.t
4.76 MB
chmod
View
DL
Edit
Rename
Delete
subsumes.t
3.16 MB
chmod
View
DL
Edit
Rename
Delete
symlinks.t
1.51 MB
chmod
View
DL
Edit
Rename
Delete
temp.t
4.99 MB
chmod
View
DL
Edit
Rename
Delete
visit.t
447 B
chmod
View
DL
Edit
Rename
Delete
zz-atomic.t
922 B
chmod
View
DL
Edit
Rename
Delete
zzz-spec.t
6.62 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /home/.cpan/build/Path-Tiny-0.146-0/t/rel-abs.t
use 5.008001; use strict; use warnings; use Test::More 0.96; use lib 't/lib'; use TestUtils qw/exception pushd tempd has_symlinks/; use Path::Tiny; # absolute() tests my $rel1 = path("."); my $abs1 = $rel1->absolute; is( $abs1->absolute, $abs1, "absolute of absolute is identity" ); my $rel2 = $rel1->child("t"); my $abs2 = $rel2->absolute; is( $rel2->absolute($abs1), $abs2, "absolute on base" ); # Note: in following relative() tests, capital 'A', 'B' denotes absolute path # and lower case 'a', 'b' denotes relative paths. 'R' denotes the root # directory. When there are multiple # letters together, they indicate how paths relate in the hierarchy: # A subsumes AB, ABC and ABD have a common prefix (referred to as AB). # The presence of an underscore indicates a symlink somewhere in that segment # of a path: ABC_D indicates a symlink somewhere between ABC and ABC_D. my @symlink_free_cases = ( # identical (absolute and relative cases) [ "A->rel(A)", "/foo/bar", "/foo/bar", "." ], [ "a->rel(a)", "foo/bar", "foo/bar", "." ], # descends -- absolute [ "AB->rel(A)", "/foo/bar/baz", "/", "foo/bar/baz" ], [ "AB->rel(A)", "/foo/bar/baz", "/foo", "bar/baz" ], [ "AB->rel(A)", "/foo/bar/baz", "/foo/bar", "baz" ], # descends -- relative [ "ab->rel(a)", "foo/bar/baz", "", "foo/bar/baz" ], [ "ab->rel(a)", "foo/bar/baz", ".", "foo/bar/baz" ], [ "ab->rel(a)", "foo/bar/baz", "foo", "bar/baz" ], [ "ab->rel(a)", "foo/bar/baz", "foo/bar", "baz" ], # common prefix -- absolute (same volume) [ "R->rel(A)", "/", "/bam", ".." ], [ "R->rel(AB)", "/", "/bam/baz", "../.." ], [ "ABC->rel(D)", "/foo/bar/baz", "/bam", "../foo/bar/baz" ], [ "ABC->rel(AD)", "/foo/bar/baz", "/foo/bam", "../bar/baz" ], [ "ABC->rel(ABD)", "/foo/bar/baz", "/foo/bar/bam", "../baz" ], [ "ABC->rel(DE)", "/foo/bar/baz", "/bim/bam", "../../foo/bar/baz" ], [ "ABC->rel(ADE)", "/foo/bar/baz", "/foo/bim/bam", "../../bar/baz" ], [ "ABC->rel(ABDE)", "/foo/bar/baz", "/foo/bar/bim/bam", "../../baz" ], # common prefix -- relative (same volume) [ "abc->rel(d)", "foo/bar/baz", "bam", "../foo/bar/baz" ], [ "abc->rel(ad)", "foo/bar/baz", "foo/bam", "../bar/baz" ], [ "abc->rel(abd)", "foo/bar/baz", "foo/bar/bam", "../baz" ], [ "abc->rel(de)", "foo/bar/baz", "bim/bam", "../../foo/bar/baz" ], [ "abc->rel(ade)", "foo/bar/baz", "foo/bim/bam", "../../bar/baz" ], [ "abc->rel(abde)", "foo/bar/baz", "foo/bar/bim/bam", "../../baz" ], # both paths relative (not identical) [ "ab->rel(a)", "foo/bar", "foo", "bar" ], [ "abc->rel(ab)", "foo/bar/baz", "foo/bim", "../bar/baz" ], [ "a->rel(b)", "foo", "bar", "../foo" ], ); for my $c (@symlink_free_cases) { my ( $label, $path, $base, $result ) = @$c; is( path($path)->relative($base), $result, $label ); } my @one_rel_from_root = ( [ "A->rel(b) from rootdir", "/foo/bar", "baz", "../foo/bar" ], [ "a->rel(B) from rootdir", "foo/bar", "/baz", "../foo/bar" ], ); { my $wd = pushd("/"); for my $c (@one_rel_from_root) { my ( $label, $path, $base, $result ) = @$c; is( path($path)->relative($base), $result, $label ); } } { my $wd = tempd("/"); my $cwd = Path::Tiny::cwd->realpath; # A->rel(b) from tmpdir -- need to find updir from ./b to root my $base = $cwd->child("baz"); my ( undef, @parts ) = split "/", $base; my $up_to_root = path( "../" x @parts ); is( path("/foo/bar")->relative("baz"), $up_to_root->child("foo/bar"), "A->rel(b) from tmpdir" ); # a->rel(B) from tempdir -- path is .. + cwd + a is( path("foo/bar")->relative("/baz"), path( "..", $cwd->_just_filepath, "foo/bar" ), "a->rel(B) from tmpdir" ); } subtest "relative on absolute paths with symlinks" => sub { my $wd = tempd; my $cwd = path(".")->realpath; my $deep = $cwd->child("foo/bar/baz/bam/bim/buz/wiz/was/woz"); $deep->mkdir(); plan skip_all => "No symlink support" unless has_symlinks(); my ( $path, $base, $expect ); # (a) symlink in common path # # A_BCD->rel(A_BEF) - common point A_BC - result: ../../C/D # $cwd->child("A")->mkdir; symlink $deep, "A/B" or die "$!"; $path = $cwd->child("A/B/C/D"); $path->mkdir; is( $path->relative( $cwd->child("A/B/E/F") ), "../../C/D", "A_BCD->rel(A_BEF)" ); $cwd->child("A")->remove_tree; $deep->remove_tree; $deep->mkdir; # (b) symlink in path from common to original path # # ABC_DE->rel(ABFG) - common point AB - result: ../../C/D/E # $cwd->child("A/B/C")->mkdir; symlink $deep, "A/B/C/D" or die "$!"; $path = $cwd->child("A/B/C/D/E"); $path->mkdir; is( $path->relative( $cwd->child("A/B/F/G") ), "../../C/D/E", "ABC_DE->rel(ABC_FG)" ); $cwd->child("A")->remove_tree; $deep->remove_tree; $deep->mkdir; # (c) symlink in path from common to new base; all path exist # # ABCD->rel(ABE_FG) - common point AB - result depends on E_F resolution # $path = $cwd->child("A/B/C/D"); $path->mkdir; $cwd->child("A/B/E")->mkdir; symlink $deep, "A/B/E/F" or die $!; $base = $cwd->child("A/B/E/F/G"); $base->mkdir; $expect = $path->relative( $deep->child("G") ); is( $path->relative($base), $expect, "ABCD->rel(ABE_FG) [real paths]" ); $cwd->child("A")->remove_tree; $deep->remove_tree; $deep->mkdir; # (d) symlink in path from common to new base; paths after symlink # don't exist # # ABCD->rel(ABE_FGH) - common point AB - result depends on E_F resolution # $path = $cwd->child("A/B/C/D"); $path->mkdir; $cwd->child("A/B/E")->mkdir; symlink $deep, "A/B/E/F" or die $!; $base = $cwd->child("A/B/E/F/G/H"); $expect = $path->relative( $deep->child("G/H") ); is( $path->relative($base), $expect, "ABCD->rel(ABE_FGH) [unreal paths]" ); $cwd->child("A")->remove_tree; $deep->remove_tree; $deep->mkdir; # (e) symlink at end of common, with updir at start of new base # # AB_CDE->rel(AB_C..FG) - common point really AB - result depends on # symlink resolution # $cwd->child("A/B")->mkdir; symlink $deep, "A/B/C" or die "$!"; $path = $cwd->child("A/B/C/D/E"); $path->mkdir; $base = $cwd->child("A/B/C/../F/G"); $base->mkdir; $expect = $path->relative( $deep->parent->child("F/G")->realpath ); is( $path->relative($base), $expect, "AB_CDE->rel(AB_C..FG)" ); $cwd->child("A")->remove_tree; $deep->remove_tree; $deep->mkdir; # (f) updirs in new base [files exist] # # ABCDE->rel(ABF..GH) - common point AB - result ../../C/D/E # $path = $cwd->child("A/B/C/D/E"); $path->mkdir; $cwd->child("A/B/F")->mkdir; $cwd->child("A/B/G/H")->mkdir; $base = $cwd->child("A/B/F/../G/H"); $expect = "../../C/D/E"; is( $path->relative($base), $expect, "ABCDE->rel(ABF..GH) [real paths]" ); $cwd->child("A")->remove_tree; # (f) updirs in new base [files don't exist] # # ABCDE->rel(ABF..GH) - common point AB - result ../../C/D/E # $path = $cwd->child("A/B/C/D/E"); $base = $cwd->child("A/B/F/../G/H"); $expect = "../../C/D/E"; is( $path->relative($base), $expect, "ABCDE->rel(ABF..GH) [unreal paths]" ); $cwd->child("A")->remove_tree; }; # XXX need to test common prefix case where both are abs but one # has volume and one doesn't. (Win32: UNC and drive letters) # XXX need to test A->rel(B) where A and B are different volumes, # including UNC and drive letters done_testing; # # This file is part of Path-Tiny # # This software is Copyright (c) 2014 by David Golden. # # This is free software, licensed under: # # The Apache License, Version 2.0, January 2004 #
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply