File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,20 @@ BOOST_AUTO_TEST_CASE(incremental_parser_parse_http_version) {
103
103
*/
104
104
BOOST_AUTO_TEST_CASE (incremental_parser_parse_status) {
105
105
typedef response_parser<tags::default_string> response_parser_type;
106
+ typedef response_parser_type::range_type range_type;
106
107
// We want to create a parser that has been initialized to a specific
107
108
// state. In this case we assume that the parser has already parsed
108
109
// the version part of the HTTP Response.
109
110
response_parser_type p (response_parser_type::http_version_done);
110
111
112
+ std::string valid_status = " 200 " ;
113
+ logic::tribool parsed_ok;
114
+ range_type result_range;
115
+ fusion::tie (parsed_ok, result_range) = p.parse_until (
116
+ response_parser_type::http_status_done,
117
+ valid_status);
118
+ BOOST_CHECK_EQUAL (parsed_ok, true );
119
+ parsed = std::string (boost::begin (result_range), boost::end (result_range));
120
+ std::cout << " PARSED: " << parsed << " state=" << p.state () << std::endl;
111
121
}
112
122
You can’t perform that action at this time.
0 commit comments