mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
* add test for MergeChunkedResponse() (#432)
This commit is contained in:
parent
ca2e148ad7
commit
8589493581
2 changed files with 27 additions and 1 deletions
25
tests/test-http-merge_chunked.cpp
Normal file
25
tests/test-http-merge_chunked.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <cassert>
|
||||
#include "../HTTP.h"
|
||||
|
||||
using namespace i2p::http;
|
||||
|
||||
int main() {
|
||||
const char *buf =
|
||||
"4\r\n"
|
||||
"HTTP\r\n"
|
||||
"A\r\n"
|
||||
" response \r\n"
|
||||
"E\r\n"
|
||||
"with \r\n"
|
||||
"chunks.\r\n"
|
||||
"0\r\n"
|
||||
"\r\n"
|
||||
;
|
||||
std::stringstream in(buf);
|
||||
std::stringstream out;
|
||||
|
||||
assert(MergeChunkedResponse(in, out) == true);
|
||||
assert(out.str() == "HTTP response with \r\nchunks.");
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue