4 # Testing cleanup_invalid_links()
13 use Test
::More tests
=> 7;
15 use English
qw(-no_match_vars);
18 cd
("$OUT_DIR/target");
20 # setup stow directory
22 make_file
('stow/.stow');
24 make_dir
('stow/perl/bin');
25 make_file
('stow/perl/bin/perl');
26 make_file
('stow/perl/bin/a2p');
27 make_dir
('stow/perl/info');
28 make_file
('stow/perl/info/perl');
29 make_dir
('stow/perl/lib/perl');
30 make_dir
('stow/perl/man/man1');
31 make_file
('stow/perl/man/man1/perl.1');
33 make_dir
('stow/emacs/bin');
34 make_file
('stow/emacs/bin/emacs');
35 make_file
('stow/emacs/bin/etags');
36 make_dir
('stow/emacs/info');
37 make_file
('stow/emacs/info/emacs');
38 make_dir
('stow/emacs/libexec/emacs');
39 make_dir
('stow/emacs/man/man1');
40 make_file
('stow/emacs/man/man1/emacs.1');
42 #setup target directory
44 make_link
('bin/a2p', '../stow/perl/bin/a2p');
45 make_link
('bin/emacs', '../stow/emacs/bin/emacs');
46 make_link
('bin/etags', '../stow/emacs/bin/etags');
47 make_link
('bin/perl', '../stow/perl/bin/perl');
50 make_link
('info/emacs', '../stow/emacs/info/emacs');
51 make_link
('info/perl', '../stow/perl/info/perl');
53 make_link
('lib', 'stow/perl/lib');
54 make_link
('libexec', 'stow/emacs/libexec');
58 make_link
('man/man1/emacs', '../../stow/emacs/man/man1/emacs.1');
59 make_link
('man/man1/perl', '../../stow/perl/man/man1/perl.1');
66 local @ARGV = ('-t', '.', '-b');
69 qr{\Askipping .*stow.*\z}xms,
70 "Skip directories containing .stow");
72 # squelch warn so that check_stow doesn't carp about skipping .stow all the time
73 $SIG{__WARN__
} = sub { };
75 @ARGV = ('-t', '.', '-l');
78 qr{emacs\nperl\nstow\n}xms,
81 @ARGV = ('-t', '.', '-b');
85 "No bogus links exist");
87 @ARGV = ('-t', '.', '-a');
94 make_file
('bin/alien');
95 @ARGV = ('-t', '.', '-a');
98 qr{Unstowed\ file:\ ./bin/alien}xms,
101 make_link
('bin/link', 'ireallyhopethisfiledoesn/t.exist');
102 @ARGV = ('-t', '.', '-b');
105 qr{Bogus\ link:\ ./bin/link}xms,
106 "Bogus links exist");
111 ok
($Target == q{/usr/local},
112 "Default target is /usr/local/");