4 use Test
::More tests
=> 18;
10 my $server = new_memcached();
11 ok($server, "started the server");
13 is($@, '', 'Basic startup works');
16 my $server = new_memcached("-l fooble");
18 ok($@, "Died with illegal -l args");
21 my $server = new_memcached("-l 127.0.0.1");
23 is($@,'', "-l 127.0.0.1 works");
26 my $server = new_memcached('-C');
27 my $stats = mem_stats($server->sock, 'settings');
28 is('no', $stats->{'cas_enabled'});
30 is($@, '', "-C works");
33 my $server = new_memcached('-b 8675');
34 my $stats = mem_stats($server->sock, 'settings');
35 is('8675', $stats->{'tcp_backlog'});
37 is($@, '', "-b works");
39 foreach my $val ('auto', 'ascii') {
41 my $server = new_memcached("-B $val");
42 my $stats = mem_stats($server->sock, 'settings');
43 ok($stats->{'binding_protocol'} =~ /$val/, "$val works");
45 is($@, '', "$val works");
48 # For the binary test, we just verify it starts since we don't have an easy bin client.
50 my $server = new_memcached("-B binary");
52 is($@, '', "binary works");
55 my $server = new_memcached("-vv -B auto");
57 is($@, '', "auto works");
60 my $server = new_memcached("-vv -B ascii");
62 is($@, '', "ascii works");
65 # For the binary test, we just verify it starts since we don't have an easy bin client.
67 my $server = new_memcached("-vv -B binary");
69 is($@, '', "binary works");
72 # Should blow up with something invalid.
74 my $server = new_memcached("-B http");
76 ok($@, "Died with illegal -B arg.");
78 # Should not allow -t 0
80 my $server = new_memcached("-t 0");
82 ok($@, "Died with illegal 0 thread count");