-
Notifications
You must be signed in to change notification settings - Fork 3
/
__clean.t
49 lines (40 loc) · 999 Bytes
/
__clean.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!perl
use warnings;
use strict;
use Test::More tests => 30;
use File::Copy qw(copy);
BEGIN {#1
use_ok( 'Devel::Examine::Subs' ) || print "Bail out!\n";
}
unlink 't/write_sample.data';
eval {
open my $copy_fh, '<', 't/write_sample.data'
or die "Can't open the write test copied file: $!";
};
like ( $@, qr/open the write/, "Test sample.data unlinked/deleted successfully" );
my @files_to_delete = qw(
t/replace_copy.data
t/sample.data.bak
t/sample.data.orig
t/search_replace.data
t/search_replace_cref.data
t/search.replace.data.bak
t/inject_after.data
t/inject.debug
t/test.bak
t/test.data
t/core_dump.debug
t/cache_dump.debug
t/config_dump.debug
t/engine_dump.debug
t/post_proc_dump.debug
t/pre_proc_dump.debug
t/remove.data
);
my @bak_glob = <*.bak>;
push @files_to_delete, @bak_glob;
for (@files_to_delete){
eval { unlink $_ if -f $_; };
ok (! $@, "test file >>$_<< deleted ok" );
}
exit if $@;