|
Lines 53-68
SKIP: {
Link Here
|
| 53 |
} |
53 |
} |
| 54 |
|
54 |
|
| 55 |
# test expiry time in cache |
55 |
# test expiry time in cache |
| 56 |
$cache->set_in_cache( "timeout", "I AM DATA", 1 ); # expiry time of 1 second |
56 |
$cache->set_in_cache( "timeout", "I AM DATA", { expiry => 1 } ); # expiry time of 1 second |
| 57 |
sleep 2; |
57 |
sleep 2; |
| 58 |
$cache->flush_L1_cache(); |
58 |
$cache->flush_L1_cache(); |
| 59 |
is( $cache->get_from_cache("timeout"), |
59 |
is( $cache->get_from_cache("timeout"), |
| 60 |
undef, "fetching expired item from cache" ); |
60 |
undef, "fetching expired item from cache" ); |
| 61 |
|
61 |
|
| 62 |
# test fetching a valid, non expired, item from cache |
62 |
# test fetching a valid, non expired, item from cache |
| 63 |
$cache->set_in_cache( "clear_me", "I AM MORE DATA", 1000 ) |
63 |
$cache->set_in_cache( "clear_me", "I AM MORE DATA", { expiry => 1000 } ) |
| 64 |
; # overly large expiry time, clear below |
64 |
; # overly large expiry time, clear below |
| 65 |
$cache->set_in_cache( "dont_clear_me", "I AM MORE DATA22", 1000 ) |
65 |
$cache->set_in_cache( "dont_clear_me", "I AM MORE DATA22", { expiry => 1000 } ) |
| 66 |
; # overly large expiry time, clear below |
66 |
; # overly large expiry time, clear below |
| 67 |
is( |
67 |
is( |
| 68 |
$cache->get_from_cache("clear_me"), |
68 |
$cache->get_from_cache("clear_me"), |
| 69 |
- |
|
|