line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
27191
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
61
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
12
|
use v5.12; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
347
|
use Test::More tests => 3; |
|
1
|
|
|
|
|
11042
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
466
|
use File::Spec::Functions; |
|
1
|
|
|
|
|
545
|
|
|
1
|
|
|
|
|
70
|
|
8
|
1
|
|
|
1
|
|
387
|
use File::Temp qw(tempdir); |
|
1
|
|
|
|
|
11883
|
|
|
1
|
|
|
|
|
46
|
|
9
|
1
|
|
|
1
|
|
203
|
use Sweet::Dir; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
10
|
1
|
|
|
1
|
|
4
|
use Sweet::File; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
11
|
1
|
|
|
1
|
|
307
|
use Sweet::File::Semaphore; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1871
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
118862
|
my $test_dir = Sweet::Dir->new(path => 't'); |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
23
|
my $file = Sweet::File->new( |
16
|
|
|
|
|
|
|
name => 'file1.txt', |
17
|
|
|
|
|
|
|
dir => $test_dir |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
3
|
my $temp_path = tempdir(); |
21
|
1
|
|
|
|
|
345
|
my $temp = Sweet::Dir->new(path => $temp_path)->create; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
23
|
my $file1 = $file->copy_to_dir($temp); |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
32
|
my $semaphore1 = Sweet::File::Semaphore->new(linked_file => $file1); |
26
|
1
|
|
|
|
|
20
|
my $semaphore1_path = $file1->path . '.ok'; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
42
|
is $semaphore1->path, $semaphore1_path, 'defaults to /path/to/file.ext.ok'; |
29
|
1
|
|
|
|
|
219
|
ok $semaphore1->does_not_exists, 'semaphore not created on instance'; |
30
|
1
|
|
|
|
|
197
|
$semaphore1->write; |
31
|
1
|
|
|
|
|
5
|
ok $semaphore1->is_a_plain_file, 'write'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|