Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated unit tests, better spec file
git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@557 b0b603af-a30f-0410-a34e-baf09ae79d0b
- Loading branch information
Showing
7 changed files
with
86 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use Test::More skip_all => "Tests not written."; # tests => 1 | ||
use Test::More tests => 8; | ||
use FindBin qw($Bin); | ||
use lib "$Bin/lib"; | ||
use MemcachedTest; | ||
|
||
my $server = new_memcached(); | ||
my $sock = $server->sock; | ||
|
||
my $count = 1; | ||
|
||
foreach my $blob ("mooo\0", "mumble\0\0\0\0\r\rblarg", "\0", "\r") { | ||
my $key = "foo$count"; | ||
my $len = length($blob); | ||
print "len is $len\n"; | ||
print $sock "set $key 0 0 $len\r\n$blob\r\n"; | ||
is(scalar <$sock>, "STORED\r\n", "stored $key"); | ||
mem_get_is($sock, $key, $blob); | ||
$count++; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use Test::More skip_all => "Tests not written."; # tests => 1 | ||
use Test::More tests => 3; | ||
use FindBin qw($Bin); | ||
use lib "$Bin/lib"; | ||
use MemcachedTest; | ||
|
||
my $server = new_memcached(); | ||
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... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters