MCPcopy Create free account
hub / github.com/boostorg/beast / testObsFold

Method testObsFold

test/beast/http/basic_parser.cpp:320–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318 }
319
320 void
321 testObsFold()
322 {
323 auto const check =
324 [&](std::string const& s, string_view value)
325 {
326 std::string m =
327 "GET / HTTP/1.1\r\n"
328 "f: " + s + "\r\n"
329 "\r\n";
330 parsegrind<request_parser<string_body>>(m,
331 [&](request_parser<string_body> const& p)
332 {
333 BEAST_EXPECT(p.get()["f"] == value);
334 });
335 };
336 check("x", "x");
337 check(" x", "x");
338 check("\tx", "x");
339 check(" \tx", "x");
340 check("\t x", "x");
341 check("x ", "x");
342 check(" x\t", "x");
343 check("\tx \t", "x");
344 check(" \tx\t ", "x");
345 check("\t x \t ", "x");
346 check("\r\n x", "x");
347 check(" \r\n x", "x");
348 check(" \r\n\tx", "x");
349 check(" \r\n\t x", "x");
350 check(" \r\n \tx", "x");
351 check(" \r\n \r\n \r\n x \t", "x");
352 check("xy", "xy");
353 check("\r\n x", "x");
354 check("\r\n x", "x");
355 check("\r\n xy", "xy");
356 check("\r\n \r\n \r\n x", "x");
357 check("\r\n \r\n \r\n xy", "xy");
358 check("x\r\n y", "x y");
359 check("x\r\n y\r\n z ", "x y z");
360 }
361
362 // Check that all callbacks are invoked
363 void

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected