# test expiry time in cache
$cache->set_in_cache( "timeout", "I AM DATA", 1 ); # expiry time of 1 second
sleep 2;
+ $cache->flush_L1_cache();
is( $cache->get_from_cache("timeout"),
undef, "fetching expired item from cache" );
);
ok( defined($myscalar), 'Created tied scalar' );
is( $$myscalar, 1, 'Constructor called to first initialize' );
+ $cache->flush_L1_cache();
is( $$myscalar, 1, 'Data retrieved from cache' );
+ $cache->flush_L1_cache();
sleep 2;
is( $$myscalar, 2, 'Constructor called again when timeout reached' );
$$myscalar = 5;
is($myhash->{'key2'}, 'surprise', 'Setting hash member worked');
$hash{'key2'} = 'nosurprise';
sleep 2;
+ $cache->flush_L1_cache();
is($myhash->{'key2'}, 'nosurprise', 'Cache change caught');
$hash{'anotherkey'} = 'anothervalue';
sleep 2;
+ $cache->flush_L1_cache();
ok(exists $myhash->{'anotherkey'}, 'Cache reset properly');