trim trailing whitespace
This commit is contained in:
parent
dda7c5a359
commit
497a067621
1 changed files with 39 additions and 39 deletions
78
t/stow.t
78
t/stow.t
|
@ -24,7 +24,7 @@ my %conflicts;
|
|||
|
||||
#
|
||||
# stow a simple tree minimally
|
||||
#
|
||||
#
|
||||
$stow = new_Stow(dir => '../stow');
|
||||
|
||||
make_dir('../stow/pkg1/bin1');
|
||||
|
@ -33,10 +33,10 @@ make_file('../stow/pkg1/bin1/file1');
|
|||
$stow->plan_stow('pkg1');
|
||||
$stow->process_tasks();
|
||||
is_deeply([ $stow->get_conflicts ], [], 'no conflicts with minimal stow');
|
||||
is(
|
||||
readlink('bin1'),
|
||||
'../stow/pkg1/bin1',
|
||||
=> 'minimal stow of a simple tree'
|
||||
is(
|
||||
readlink('bin1'),
|
||||
'../stow/pkg1/bin1',
|
||||
=> 'minimal stow of a simple tree'
|
||||
);
|
||||
|
||||
#
|
||||
|
@ -50,14 +50,14 @@ make_dir('lib2');
|
|||
|
||||
$stow->plan_stow('pkg2');
|
||||
$stow->process_tasks();
|
||||
is(
|
||||
is(
|
||||
readlink('lib2/file2'),
|
||||
'../../stow/pkg2/lib2/file2',
|
||||
=> 'stow simple tree to existing directory'
|
||||
'../../stow/pkg2/lib2/file2',
|
||||
=> 'stow simple tree to existing directory'
|
||||
);
|
||||
|
||||
#
|
||||
# unfold existing tree
|
||||
# unfold existing tree
|
||||
#
|
||||
$stow = new_Stow();
|
||||
|
||||
|
@ -70,10 +70,10 @@ make_file('../stow/pkg3b/bin3/file3b');
|
|||
|
||||
$stow->plan_stow('pkg3b');
|
||||
$stow->process_tasks();
|
||||
ok(
|
||||
ok(
|
||||
-d 'bin3' &&
|
||||
readlink('bin3/file3a') eq '../../stow/pkg3a/bin3/file3a' &&
|
||||
readlink('bin3/file3b') eq '../../stow/pkg3b/bin3/file3b'
|
||||
readlink('bin3/file3b') eq '../../stow/pkg3b/bin3/file3b'
|
||||
=> 'target already has 1 stowed package'
|
||||
);
|
||||
|
||||
|
@ -84,8 +84,8 @@ ok(
|
|||
$stow = new_Stow();
|
||||
|
||||
make_file('bin4'); # this is a file but named like a directory
|
||||
make_dir('../stow/pkg4/bin4');
|
||||
make_file('../stow/pkg4/bin4/file4');
|
||||
make_dir('../stow/pkg4/bin4');
|
||||
make_file('../stow/pkg4/bin4/file4');
|
||||
|
||||
$stow->plan_stow('pkg4');
|
||||
%conflicts = $stow->get_conflicts();
|
||||
|
@ -104,14 +104,14 @@ ok(
|
|||
$stow = new_Stow();
|
||||
|
||||
make_file('bin4a'); # this is a file but named like a directory
|
||||
make_dir('../stow/pkg4a/bin4a');
|
||||
make_file('../stow/pkg4a/bin4a/file4a');
|
||||
make_dir('../stow/pkg4a/bin4a');
|
||||
make_file('../stow/pkg4a/bin4a/file4a');
|
||||
|
||||
$stow->plan_stow('pkg4a');
|
||||
%conflicts = $stow->get_conflicts();
|
||||
ok(
|
||||
$stow->get_conflict_count == 1 &&
|
||||
$conflicts{stow}{pkg4a}[0] =~
|
||||
$conflicts{stow}{pkg4a}[0] =~
|
||||
qr/existing target is neither a link nor a directory/
|
||||
=> 'link to new dir bin4a conflicts with existing non-directory'
|
||||
);
|
||||
|
@ -124,11 +124,11 @@ $stow = new_Stow();
|
|||
|
||||
# Populate target
|
||||
make_file('file4b', 'file4b - version originally in target');
|
||||
make_dir ('bin4b');
|
||||
make_dir ('bin4b');
|
||||
make_file('bin4b/file4b', 'bin4b/file4b - version originally in target');
|
||||
|
||||
# Populate
|
||||
make_dir ('../stow/pkg4b/bin4b');
|
||||
make_dir ('../stow/pkg4b/bin4b');
|
||||
make_file('../stow/pkg4b/file4b', 'file4b - version originally in stow package');
|
||||
make_file('../stow/pkg4b/bin4b/file4b', 'bin4b/file4b - version originally in stow package');
|
||||
|
||||
|
@ -151,11 +151,11 @@ $stow = new_Stow(adopt => 1);
|
|||
|
||||
# Populate target
|
||||
make_file('file4c', "file4c - version originally in target\n");
|
||||
make_dir ('bin4c');
|
||||
make_dir ('bin4c');
|
||||
make_file('bin4c/file4c', "bin4c/file4c - version originally in target\n");
|
||||
|
||||
# Populate
|
||||
make_dir ('../stow/pkg4c/bin4c');
|
||||
make_dir ('../stow/pkg4c/bin4c');
|
||||
make_file('../stow/pkg4c/file4c', "file4c - version originally in stow package\n");
|
||||
make_file('../stow/pkg4c/bin4c/file4c', "bin4c/file4c - version originally in stow package\n");
|
||||
|
||||
|
@ -173,26 +173,26 @@ for my $file ('file4c', 'bin4c/file4c') {
|
|||
is(cat_file($file), "$file - version originally in target\n" => "$file has right contents");
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Target already exists but is not owned by stow
|
||||
#
|
||||
$stow = new_Stow();
|
||||
|
||||
make_dir('bin5');
|
||||
make_dir('bin5');
|
||||
make_invalid_link('bin5/file5','../../empty');
|
||||
make_dir('../stow/pkg5/bin5/file5');
|
||||
make_dir('../stow/pkg5/bin5/file5');
|
||||
|
||||
$stow->plan_stow('pkg5');
|
||||
%conflicts = $stow->get_conflicts();
|
||||
like(
|
||||
like(
|
||||
$conflicts{stow}{pkg5}[-1],
|
||||
qr/not owned by stow/
|
||||
=> 'target already exists but is not owned by stow'
|
||||
);
|
||||
|
||||
#
|
||||
# Replace existing but invalid target
|
||||
# Replace existing but invalid target
|
||||
#
|
||||
$stow = new_Stow();
|
||||
|
||||
|
@ -202,9 +202,9 @@ make_file('../stow/pkg6/file6');
|
|||
|
||||
$stow->plan_stow('pkg6');
|
||||
$stow->process_tasks();
|
||||
is(
|
||||
is(
|
||||
readlink('file6'),
|
||||
'../stow/pkg6/file6'
|
||||
'../stow/pkg6/file6'
|
||||
=> 'replace existing but invalid target'
|
||||
);
|
||||
|
||||
|
@ -243,11 +243,11 @@ make_file('../stow/pkg8b/0/file8b');
|
|||
|
||||
$stow->plan_stow('pkg8b');
|
||||
$stow->process_tasks();
|
||||
ok(
|
||||
ok(
|
||||
$stow->get_conflict_count == 0 &&
|
||||
-d '0' &&
|
||||
readlink('0/file8a') eq '../../stow/pkg8a/0/file8a' &&
|
||||
readlink('0/file8b') eq '../../stow/pkg8b/0/file8b'
|
||||
readlink('0/file8b') eq '../../stow/pkg8b/0/file8b'
|
||||
=> 'stowing directories named 0'
|
||||
);
|
||||
|
||||
|
@ -266,9 +266,9 @@ make_file('../stow/pkg9b/man9/man1/file9.1');
|
|||
|
||||
$stow->plan_stow('pkg9b');
|
||||
$stow->process_tasks();
|
||||
ok(
|
||||
ok(
|
||||
$stow->get_conflict_count == 0 &&
|
||||
readlink('man9/man1/file9.1') eq '../../../stow/pkg9b/man9/man1/file9.1'
|
||||
readlink('man9/man1/file9.1') eq '../../../stow/pkg9b/man9/man1/file9.1'
|
||||
=> 'overriding existing documentation files'
|
||||
);
|
||||
|
||||
|
@ -287,9 +287,9 @@ make_file('../stow/pkg10b/man10/man1/file10.1');
|
|||
|
||||
$stow->plan_stow('pkg10b');
|
||||
is($stow->get_tasks, 0, 'no tasks to process');
|
||||
ok(
|
||||
ok(
|
||||
$stow->get_conflict_count == 0 &&
|
||||
readlink('man10/man1/file10.1') eq '../../../stow/pkg10a/man10/man1/file10.1'
|
||||
readlink('man10/man1/file10.1') eq '../../../stow/pkg10a/man10/man1/file10.1'
|
||||
=> 'defer to existing documentation files'
|
||||
);
|
||||
|
||||
|
@ -306,10 +306,10 @@ make_dir('man11/man1');
|
|||
|
||||
$stow->plan_stow('pkg11');
|
||||
$stow->process_tasks();
|
||||
ok(
|
||||
ok(
|
||||
$stow->get_conflict_count == 0 &&
|
||||
readlink('man11/man1/file11.1') eq '../../../stow/pkg11/man11/man1/file11.1' &&
|
||||
!-e 'man11/man1/file11.1~' &&
|
||||
!-e 'man11/man1/file11.1~' &&
|
||||
!-e 'man11/man1/.#file11.1'
|
||||
=> 'ignore temp files'
|
||||
);
|
||||
|
@ -327,7 +327,7 @@ make_dir('lib12/');
|
|||
|
||||
$stow->plan_stow('pkg12');
|
||||
$stow->process_tasks();
|
||||
ok(
|
||||
ok(
|
||||
$stow->get_conflict_count == 0 &&
|
||||
readlink('lib12/lib.so.1') eq '../../stow/pkg12/lib12/lib.so.1' &&
|
||||
readlink('lib12/lib.so' ) eq '../../stow/pkg12/lib12/lib.so'
|
||||
|
@ -350,12 +350,12 @@ make_link('../stow/pkg13b/lib13/libb.so', 'libb.so.1');
|
|||
|
||||
$stow->plan_stow('pkg13b');
|
||||
$stow->process_tasks();
|
||||
ok(
|
||||
ok(
|
||||
$stow->get_conflict_count == 0 &&
|
||||
readlink('lib13/liba.so.1') eq '../../stow/pkg13a/lib13/liba.so.1' &&
|
||||
readlink('lib13/liba.so' ) eq '../../stow/pkg13a/lib13/liba.so' &&
|
||||
readlink('lib13/libb.so.1') eq '../../stow/pkg13b/lib13/libb.so.1' &&
|
||||
readlink('lib13/libb.so' ) eq '../../stow/pkg13b/lib13/libb.so'
|
||||
readlink('lib13/libb.so.1') eq '../../stow/pkg13b/lib13/libb.so.1' &&
|
||||
readlink('lib13/libb.so' ) eq '../../stow/pkg13b/lib13/libb.so'
|
||||
=> 'unfolding to stow links to libraries'
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue