Lines 43-48
SKIP: {
Link Here
|
43 |
# test expiry time in cache |
43 |
# test expiry time in cache |
44 |
$cache->set_in_cache( "timeout", "I AM DATA", 1 ); # expiry time of 1 second |
44 |
$cache->set_in_cache( "timeout", "I AM DATA", 1 ); # expiry time of 1 second |
45 |
sleep 2; |
45 |
sleep 2; |
|
|
46 |
$cache->flush_L1_cache(); |
46 |
is( $cache->get_from_cache("timeout"), |
47 |
is( $cache->get_from_cache("timeout"), |
47 |
undef, "fetching expired item from cache" ); |
48 |
undef, "fetching expired item from cache" ); |
48 |
|
49 |
|
Lines 88-94
SKIP: {
Link Here
|
88 |
); |
89 |
); |
89 |
ok( defined($myscalar), 'Created tied scalar' ); |
90 |
ok( defined($myscalar), 'Created tied scalar' ); |
90 |
is( $$myscalar, 1, 'Constructor called to first initialize' ); |
91 |
is( $$myscalar, 1, 'Constructor called to first initialize' ); |
|
|
92 |
$cache->flush_L1_cache(); |
91 |
is( $$myscalar, 1, 'Data retrieved from cache' ); |
93 |
is( $$myscalar, 1, 'Data retrieved from cache' ); |
|
|
94 |
$cache->flush_L1_cache(); |
92 |
sleep 2; |
95 |
sleep 2; |
93 |
is( $$myscalar, 2, 'Constructor called again when timeout reached' ); |
96 |
is( $$myscalar, 2, 'Constructor called again when timeout reached' ); |
94 |
$$myscalar = 5; |
97 |
$$myscalar = 5; |
Lines 119-124
SKIP: {
Link Here
|
119 |
is($myhash->{'key2'}, 'surprise', 'Setting hash member worked'); |
122 |
is($myhash->{'key2'}, 'surprise', 'Setting hash member worked'); |
120 |
$hash{'key2'} = 'nosurprise'; |
123 |
$hash{'key2'} = 'nosurprise'; |
121 |
sleep 2; |
124 |
sleep 2; |
|
|
125 |
$cache->flush_L1_cache(); |
122 |
is($myhash->{'key2'}, 'nosurprise', 'Cache change caught'); |
126 |
is($myhash->{'key2'}, 'nosurprise', 'Cache change caught'); |
123 |
|
127 |
|
124 |
|
128 |
|
Lines 134-139
SKIP: {
Link Here
|
134 |
$hash{'anotherkey'} = 'anothervalue'; |
138 |
$hash{'anotherkey'} = 'anothervalue'; |
135 |
|
139 |
|
136 |
sleep 2; |
140 |
sleep 2; |
|
|
141 |
$cache->flush_L1_cache(); |
137 |
|
142 |
|
138 |
ok(exists $myhash->{'anotherkey'}, 'Cache reset properly'); |
143 |
ok(exists $myhash->{'anotherkey'}, 'Cache reset properly'); |
139 |
|
144 |
|
140 |
- |
|
|