Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jacob Vorreuter
committed
Oct 20, 2009
1 parent
4e9885e
commit f6d086a
Showing
8 changed files
with
85 additions
and
98 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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env escript | ||
%% -*- erlang -*- | ||
%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell | ||
|
||
main(_) -> | ||
etap:plan(unknown), | ||
|
||
(fun() -> | ||
{ok, Socket} = gen_tcp:connect("localhost", 11211, [binary, {packet, 0}, {active, false}]), | ||
|
||
gen_tcp:send(Socket, <<128,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>), | ||
etap:ok((fun({ok, _}) -> true; (_) -> false end)(gen_tcp:recv(Socket, 0, 2000)), "noop"), | ||
|
||
gen_tcp:send(Socket, <<128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>), | ||
|
||
ok | ||
end)(), | ||
|
||
(fun() -> | ||
etap:is(erlmc:start(), ok, "erlmc connect to default memcached server ok"), | ||
|
||
etap:is(erlmc:set("Hello", <<"World">>), <<>>, "set ok"), | ||
etap:is(erlmc:add("Hello", <<"Fail">>), <<"Data exists for key.">>, "add ok"), | ||
etap:is(erlmc:get("Hello"), <<"World">>, "get ok"), | ||
etap:is(erlmc:delete("Hello"), <<>>, "delete ok"), | ||
etap:is(erlmc:add("Hello", <<"World2">>), <<>>, "add ok"), | ||
etap:is(erlmc:get("Hello"), <<"World2">>, "get ok"), | ||
etap:is(erlmc:append("Hello", <<"!!!">>), <<>>, "append ok"), | ||
etap:is(erlmc:get("Hello"), <<"World2!!!">>, "get ok"), | ||
etap:is(erlmc:prepend("Hello", <<"$$$">>), <<>>, "prepend ok"), | ||
etap:is(erlmc:get("Hello"), <<"$$$World2!!!">>, "get ok"), | ||
etap:is(erlmc:delete("Hello"), <<>>, "delete ok"), | ||
etap:is(erlmc:get("Hello"), <<>>, "get ok"), | ||
|
||
erlmc:set("One", <<"A">>), | ||
erlmc:set("Two", <<"B">>), | ||
erlmc:set("Three", <<"C">>), | ||
|
||
etap:is(erlmc:get_many(["One", "Two", "Two-and-a-half", "Three"]), [{"One",<<"A">>},{"Two",<<"B">>},{"Two-and-a-half",<<>>},{"Three",<<"C">>}], "get_many ok"), | ||
|
||
etap:is(erlmc:flush(0), [{{"localhost",11211},<<>>}], "flush ok"), | ||
|
||
etap:is(erlmc:quit(), [{{"localhost",11211},[true]}], "quit ok"), | ||
|
||
ok | ||
end)(), | ||
|
||
etap:end_tests(). |
This file was deleted.
Oops, something went wrong.
f6d086a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to drop my mcerlang repos then?