MCPcopy Create free account
hub / github.com/boostorg/parser / main

Function main

test/parser_rule_with_params.cpp:75–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73};
74
75int main()
76{
77
78// no_attribute_rules
79{
80 {
81 std::string const str = "xyz";
82 BOOST_TEST(!parse(str, flat_rule.with(15.0, make_13)));
83 BOOST_TEST(!parse(str, recursive_rule.with(15.0, make_13)));
84 }
85 {
86 std::string const str = "def";
87 bool const flat_result{parse(str, flat_rule.with(15.0, make_13))};
88 BOOST_TEST(flat_result);
89 BOOST_TEST(!parse(str, recursive_rule.with(15.0, make_13)));
90 }
91 {
92 std::string const str = "abc";
93 BOOST_TEST(parse(str, flat_rule.with(15.0, make_13)));
94 BOOST_TEST(parse(str, recursive_rule.with(15.0, make_13)));
95 }
96 {
97 std::string const str = "abcaabc";
98 BOOST_TEST(!parse(str, flat_rule.with(15.0, make_13)));
99 BOOST_TEST(parse(str, recursive_rule.with(15.0, make_13)));
100 }
101 {
102 std::string const str = "abcaabc";
103 auto first = str.c_str();
104 BOOST_TEST(prefix_parse(
105 first,
106 boost::parser::detail::text::null_sentinel,
107 flat_rule.with(15.0, make_13)));
108 first = str.c_str();
109 BOOST_TEST(prefix_parse(
110 first,
111 boost::parser::detail::text::null_sentinel,
112 recursive_rule.with(15.0, make_13)));
113 }
114}
115
116// string_attribute_rules
117{
118 {
119 std::string const str = "xyz";
120 BOOST_TEST(!parse(str, flat_string_rule.with(15.0, make_13)));
121 BOOST_TEST(!parse(str, recursive_string_rule.with(15.0, make_13)));
122 }
123 {
124 std::string const str = "def";
125 auto const flat_result =
126 parse(str, flat_string_rule.with(15.0, make_13));
127 BOOST_TEST(flat_result);
128 BOOST_TEST(*flat_result == "def");
129 BOOST_TEST(!parse(str, recursive_string_rule.with(15.0, make_13)));
130 }
131 {
132 std::string const str = "abc";

Callers

nothing calls this directly

Calls 5

prefix_parseFunction · 0.85
callback_prefix_parseFunction · 0.85
parseFunction · 0.50
withMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected