ACIL FM
Dark
Refresh
Current DIR:
/home/.cpan/build/Test-File-1.993-0/t
/
home
.cpan
build
Test-File-1.993-0
t
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
rt
-
chmod
Open
Rename
Delete
dm_skeleton.t
1.51 MB
chmod
View
DL
Edit
Rename
Delete
file_contains.t
5.05 MB
chmod
View
DL
Edit
Rename
Delete
file_contains_encoded.t
2.96 MB
chmod
View
DL
Edit
Rename
Delete
file_contains_utf8.t
2.97 MB
chmod
View
DL
Edit
Rename
Delete
file_mtime.t
3.02 MB
chmod
View
DL
Edit
Rename
Delete
file_sizes.t
4.71 MB
chmod
View
DL
Edit
Rename
Delete
line_counters.t
5.21 MB
chmod
View
DL
Edit
Rename
Delete
links.t
5.23 MB
chmod
View
DL
Edit
Rename
Delete
link_counts.t
2.47 MB
chmod
View
DL
Edit
Rename
Delete
load.t
158 B
chmod
View
DL
Edit
Rename
Delete
normalize.t
1.81 MB
chmod
View
DL
Edit
Rename
Delete
obviously_non_multi_user.t
1.53 MB
chmod
View
DL
Edit
Rename
Delete
owner.t
5.75 MB
chmod
View
DL
Edit
Rename
Delete
pod.t
129 B
chmod
View
DL
Edit
Rename
Delete
pod_coverage.t
161 B
chmod
View
DL
Edit
Rename
Delete
setup_common
1.89 MB
chmod
View
DL
Edit
Rename
Delete
test_dirs.t
1.42 MB
chmod
View
DL
Edit
Rename
Delete
test_files.t
9.99 MB
chmod
View
DL
Edit
Rename
Delete
test_manifest
282 B
chmod
View
DL
Edit
Rename
Delete
win32.t
929 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /home/.cpan/build/Test-File-1.993-0/t/owner.t
use strict; use Test::Builder::Tester; use Test::More; use Test::File; # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #let's test with the first file we find in the current dir my( $filename, $file_gid, $owner_uid, $owner_name, $file_group_name ); eval { $filename = glob( "*" ); die "Could not find a file" unless defined $filename; $owner_uid = ( stat $filename )[4]; die "failed to find ${filename}'s owner\n" unless defined $owner_uid; $file_gid = ( stat $filename )[5]; die "failed to find ${filename}'s owner\n" unless defined $file_gid; $owner_name = ( getpwuid $owner_uid )[0]; die "failed to find ${filename}'s owner as name\n" unless defined $owner_name; $file_group_name = ( getgrgid $file_gid )[0]; die "failed to find ${filename}'s group as name\n" unless defined $file_group_name; }; plan skip_all => "I can't find a file to test with: $@" if $@; # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # find some name that isn't the one we found before my( $other_name, $other_uid, $other_group_name, $other_gid ); eval { for( my $i = 0; $i < 65535; $i++ ) { next if $i == $owner_uid; my @stats = getpwuid $i; next unless @stats; ( $other_uid, $other_name ) = ( $i, $stats[0] ); last; } # XXX: why the for loop? for( my $i = 0; $i < 65535; $i++ ) { next if $i == $file_gid; my @stats = getgrgid $i; next unless @stats; ( $other_gid, $other_group_name ) = ( $i, $stats[0] ); last; } die "Failed to find another uid" unless defined $other_uid; die "Failed to find name for other uid ($other_uid)" unless defined $other_name; die "Failed to find another gid" unless defined $other_gid; die "Failed to find name for other gid ($other_gid)" unless defined $other_group_name; }; plan skip_all => "I can't find a second user id to test with: $@" if $@; # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # find some names that don't exist, to test bad input my( $invalid_user_name, $invalid_group_name ); eval { foreach my $user ( 'aaaa' .. 'zzzz' ) { my @stats = getpwnam $user; next if @stats; $invalid_user_name = $user; #diag "Using invalid user [$user] for tests"; last; } foreach my $group ( 'aaaa' .. 'zzzz' ) { my @stats = getpwnam $group; next if @stats; $invalid_group_name = $group; #diag "Using invalid group [$group] for tests"; last; } diag "Failed to find an invalid username" unless defined $other_uid; diag "Failed to find another gid" unless defined $other_gid; }; # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # test owner stuff owner_is( $filename, $owner_name, 'owner_is with text username' ); owner_is( $filename, $owner_uid, 'owner_is with numeric UID' ); owner_isnt( $filename, $other_name, 'owner_isnt with text username' ); owner_isnt( $filename, $other_uid, 'owner_isnt with numeric UID' ); my $name = 'Intentional owner_is failure with wrong user'; my $testname = "$filename belongs to $other_name"; test_out( "not ok 1 - $testname"); test_diag( "file [$filename] belongs to $owner_name ($owner_uid), not $other_name " . "($other_uid)\n" . "# Failed test '$testname'\n". "# at t/owner.t line " . line_num(+6) . "." ); owner_is( $filename, $other_name ); test_test( $name ); $name = "Intentional owner_is failure with invalid user [$invalid_user_name]"; $testname = "$filename belongs to $invalid_user_name"; test_out( "not ok 1 - $testname"); test_diag( "user [$invalid_user_name] does not exist on this system\n" . "# Failed test '$testname'\n". "# at t/owner.t line " . line_num(+5) . "." ); owner_is( $filename, $invalid_user_name ); test_test( $name ); $name = 'owner_isnt for non-existent name'; $testname = "$filename doesn't belong to $invalid_user_name"; test_out( "ok 1 - $testname"); owner_isnt( $filename, $invalid_user_name ); test_test( $name ); $name = 'Intentional owner_isnt failure'; $testname = "$filename doesn't belong to $owner_name"; test_out( "not ok 1 - $testname"); test_diag( "file [$filename] belongs to $owner_name ($owner_uid)\n" . "# Failed test '$testname'\n" . "# at t/owner.t line " . line_num(+5) . "." ); owner_isnt( $filename, $owner_name ); test_test( $name ); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # test group stuff group_is( $filename, $file_group_name, 'group_is with text groupname' ); group_is( $filename, $file_group_name ); group_is( $filename, $file_gid, 'group_is with numeric GID' ); group_isnt( $filename, $other_group_name, 'group_isnt with text groupname' ); group_isnt( $filename, $other_gid, 'group_isnt with numeric GID' ); group_isnt( $filename, $other_gid ); $name = 'Intentional group_is failure'; test_out( "not ok 1 - $name"); test_diag( "file [$filename] belongs to $file_group_name ($file_gid), not ". "$other_group_name " . "($other_gid)\n" . "# Failed test '$name'\n". "# at t/owner.t line " . line_num(+7) . "." ); group_is( $filename, $other_group_name, $name ); test_test( $name ); $name = "Intentional group_is failure with invalid group [$invalid_group_name]"; test_out( "not ok 1 - $name"); test_diag( "group [$invalid_group_name] does not exist on this system\n" . "# Failed test '$name'\n". "# at t/owner.t line " . line_num(+5) . "." ); group_is( $filename, $invalid_group_name, $name ); test_test( $name ); $name = 'Intentional group_isnt failure'; test_out( "not ok 1 - $name"); test_diag( "file [$filename] belongs to $file_group_name ($file_gid)\n" . "# Failed test '$name'\n" . "# at t/owner.t line " . line_num(+5) . "." ); group_isnt( $filename, $file_group_name, $name ); test_test( $name ); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # done_testing();
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply