INSTALL.md: move clean-up to a separate section
[gnu-stow.git] / t / defer.t
blob4434e0fbce38121540ac50b01825d4e29c0f2a6c
1 #!/usr/bin/perl
3 # This file is part of GNU Stow.
5 # GNU Stow is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # GNU Stow is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see https://www.gnu.org/licenses/.
19 # Testing defer().
22 use strict;
23 use warnings;
25 use testutil;
27 use Test::More tests => 4;
29 init_test_dirs();
30 cd("$TEST_DIR/target");
32 my $stow;
34 $stow = new_Stow(defer => [ 'man' ]);
35 ok($stow->defer('man/man1/file.1') => 'simple success');
37 $stow = new_Stow(defer => [ 'lib' ]);
38 ok(! $stow->defer('man/man1/file.1') => 'simple failure');
40 $stow = new_Stow(defer => [ 'lib', 'man', 'share' ]);
41 ok($stow->defer('man/man1/file.1') => 'complex success');
43 $stow = new_Stow(defer => [ 'lib', 'man', 'share' ]);
44 ok(! $stow->defer('bin/file') => 'complex failure');