diff options
author | Paul Joseph Davis <davisp@apache.org> | 2009-06-11 01:59:56 +0000 |
---|---|---|
committer | Paul Joseph Davis <davisp@apache.org> | 2009-06-11 01:59:56 +0000 |
commit | 58ad7ad6c330bf65b89e0f5e4a790d14510d3ce7 (patch) | |
tree | 5baa5df527bcdde74198b0ea1835e75463309063 /src/couchdb/couch_stream.erl | |
parent | 7fa9f2473a57008000597935a42893771ab156a8 (diff) |
Integrating more ETAP tests from Bob Dionne.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@783600 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_stream.erl')
-rw-r--r-- | src/couchdb/couch_stream.erl | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/src/couchdb/couch_stream.erl b/src/couchdb/couch_stream.erl index ed7ca01e..252fca7f 100644 --- a/src/couchdb/couch_stream.erl +++ b/src/couchdb/couch_stream.erl @@ -174,39 +174,5 @@ old_stream_data(Fd, {Pos, Offset}, Num, MaxChunk, Fun, Acc) -> old_stream_data(Fd, Sp, Num - ReadAmount, MaxChunk, Fun, Fun(Bin, Acc)). - -%%% Tests %%% - -read_all(Fd, PosList) -> - iolist_to_binary(foldl(Fd, PosList, - fun(Bin, Acc) -> - [Bin, Acc] - end, [])). - - -test() -> - {ok, Fd} = couch_file:open("foo", [create,overwrite]), - ok = couch_file:write_header(Fd, {howdy, howdy}), - Bin = <<"damienkatz">>, - {ok, Pos} = couch_file:append_binary(Fd, Bin), - {ok, Bin} = couch_file:pread_binary(Fd, Pos), - {ok, {howdy, howdy}} = couch_file:read_header(Fd), - ok = couch_file:write_header(Fd, {foo, foo}), - {ok, {foo, foo}} = couch_file:read_header(Fd), - - {ok, Stream} = open(Fd), - ok = write(Stream, <<"food">>), - ok = write(Stream, <<"foob">>), - {PosList, 8} = close(Stream), - <<"foodfoob">> = read_all(Fd, PosList), - {ok, Stream2} = open(Fd), - OneBits = <<1:(8*10)>>, - ZeroBits = <<0:(8*10)>>, - ok = write(Stream2, OneBits), - ok = write(Stream2, ZeroBits), - {PosList2, 20} = close(Stream2), - AllBits = iolist_to_binary([OneBits,ZeroBits]), - AllBits = read_all(Fd, PosList2), - couch_file:close(Fd), - PosList2. +% Tests moved to tests/etap/050-stream.t |