File: unixsocket.t

package info (click to toggle)
memcached 1.4.21-1.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 2,308 kB
  • ctags: 1,954
  • sloc: ansic: 10,385; sh: 4,359; perl: 4,054; xml: 1,634; makefile: 148
file content (24 lines) | stat: -rwxr-xr-x 503 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl

use strict;
use Test::More tests => 3;
use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;

my $filename = "/tmp/memcachetest$$";

my $server = new_memcached("-s $filename");
my $sock = $server->sock;

ok(-S $filename, "creating unix domain socket $filename");

# set foo (and should get it)
print $sock "set foo 0 0 6\r\nfooval\r\n";

is(scalar <$sock>, "STORED\r\n", "stored foo");
mem_get_is($sock, "foo", "fooval");

unlink($filename);

## Just some basic stuff for now...