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

Method testUpgradeField

test/beast/http/basic_parser.cpp:791–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789 }
790
791 void
792 testUpgradeField()
793 {
794 auto const m = [](std::string const& s)
795 { return "GET / HTTP/1.1\r\n" + s + "\r\n"; };
796
797 using P = test_parser<true>;
798
799 parsegrind<P>(m("Upgrade:\r\n"), expect_flags{*this, parse_flag::upgrade});
800 parsegrind<P>(m("Upgrade: \r\n"), expect_flags{*this, parse_flag::upgrade});
801 parsegrind<P>(m("Upgrade: yes\r\n"), expect_flags{*this, parse_flag::upgrade});
802
803 parsegrind<P>(m("Up: yes\r\n"), expect_flags{*this, 0});
804 parsegrind<P>(m("UpgradX: none\r\n"), expect_flags{*this, 0});
805 parsegrind<P>(m("Upgrades: 2\r\n"), expect_flags{*this, 0});
806 parsegrind<P>(m("Upsample: 4x\r\n"), expect_flags{*this, 0});
807
808 parsegrind<P>(
809 "GET / HTTP/1.1\r\n"
810 "Connection: upgrade\r\n"
811 "Upgrade: WebSocket\r\n"
812 "\r\n",
813 [&](P const& p)
814 {
815 BEAST_EXPECT(p.upgrade());
816 });
817 }
818
819 void
820 testPartial()

Callers

nothing calls this directly

Calls 1

upgradeMethod · 0.80

Tested by

no test coverage detected