File Coverage

blib/lib/Test/Attean/MutableTimeCacheableQuadStore.pm
Criterion Covered Total %
statement 17 18 94.4
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 23 26 88.4


line stmt bran cond sub pod time code
1              
2             use v5.14;
3 1     1   10223 use warnings;
  1         4  
4 1     1   4 use Test::Roo::Role;
  1         2  
  1         32  
5 1     1   5 use Test::Moose;
  1         3  
  1         11  
6 1     1   1099 use Attean;
  1         1  
  1         11  
7 1     1   584 use Attean::RDF;
  1         3  
  1         8  
8 1     1   6  
  1         3  
  1         9  
9             requires 'create_store'; # create_store( quads => \@quads )
10             with 'Test::Attean::StoreCleanup';
11             with 'Test::Attean::TimeCacheableQuadStore';
12              
13             return 30;
14             }
15 0     0 0    
16             test 'mutable timecacheablequadstore' => sub {
17             my $self = shift;
18             my $q1 = quad(iri('s'), iri('p'), iri('o'), iri('g'));
19             my $q2 = quad(iri('x'), iri('y'), iri('z'), iri('g'));
20             my $store = $self->create_store(quads => [$q1, $q2]);
21             my $start = $store->mtime_for_quads();
22             my $s = $self->caching_sleep_time;
23             note("Sleeping for $s seconds");
24             sleep($s);
25             $store->remove_quad($q1);
26             my $end = $store->mtime_for_quads();
27             my $diff = abs($end - $start);
28             isnt($start, $end, "mtime changed after update (by $diff seconds)");
29             $self->cleanup_store($store);
30             };
31              
32             1;