test-http-merge_chunked.cpp 413 B

1234567891011121314151617181920212223242526
  1. #include <cassert>
  2. #include "../HTTP.h"
  3. using namespace i2p::http;
  4. int main() {
  5. const char *buf =
  6. "4\r\n"
  7. "HTTP\r\n"
  8. "A\r\n"
  9. " response \r\n"
  10. "E\r\n"
  11. "with \r\n"
  12. "chunks.\r\n"
  13. "0\r\n"
  14. "\r\n"
  15. ;
  16. std::stringstream in(buf);
  17. std::stringstream out;
  18. assert(MergeChunkedResponse(in, out) == true);
  19. assert(out.str() == "HTTP response with \r\nchunks.");
  20. return 0;
  21. }