File: 13_cas.t

package info (click to toggle)
libcache-memcached-libmemcached-perl 0.04001-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 340 kB
  • sloc: perl: 2,274; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use strict;
use lib 't/lib';
use libmemcached_test;
use Test::More;

my $cache = libmemcached_test_create({
    min_version => '1.4.4',
    behavior_support_cas => 1,
});

plan skip_all => "cas() unimplemented";

plan tests => 5;

my @keys = ('a' .. 'z');
$cache->set($_, $_) for @keys;
my $cas = $cache->get_cas('a');
ok($cas);

my $h = $cache->get_cas_multi(@keys);
ok($h);
isa_ok($h, 'HASH');

is($h->{a}, $cas);

TODO: {
local $TODO = "cas() unconfirmed";
my $newvalue = 'this used to be a';
$cache->cas('a', $cas, $newvalue);
is($cache->get('a'), $newvalue);
}