Home | History | Annotate | Download | only in tests

Lines Matching defs:match

21     static MatchT Match(const char* in) {
34 static MatchT Match(const char* in) {
54 const auto match = EOS::Match(gTests[i].fInput);
55 REPORTER_ASSERT(r, match == gTests[i].fMatch);
56 REPORTER_ASSERT(r, match.fNext == (match ? gTests[i].fInput : nullptr));
74 const auto match = LIT<'X'>::Match(gTests[i].fInput);
75 REPORTER_ASSERT(r, match == gTests[i].fMatch);
76 REPORTER_ASSERT(r, match.fNext == (match ? gTests[i].fInput + 1 : nullptr));
79 REPORTER_ASSERT(r, !(LIT<'F', 'o', 'o'>::Match("")));
80 REPORTER_ASSERT(r, !(LIT<'F', 'o', 'o'>::Match("Fo")));
81 REPORTER_ASSERT(r, !(LIT<'F', 'o', 'o'>::Match("FoO")));
82 REPORTER_ASSERT(r, (LIT<'F', 'o', 'o'>::Match("Foo")));
83 REPORTER_ASSERT(r, (LIT<'F', 'o', 'o'>::Match("Foobar")));
109 const auto match = Alpha::Match(gTests[i].fInput);
110 REPORTER_ASSERT(r, match == gTests[i].fMatch);
111 REPORTER_ASSERT(r, match.fNext == (match ? gTests[i].fInput + 1 : nullptr));
112 if (match) {
113 REPORTER_ASSERT(r, *match == gTests[i].fMatchValue);
135 const auto match = Digit::Match(gTests[i].fInput);
136 REPORTER_ASSERT(r, match == gTests[i].fMatch);
137 REPORTER_ASSERT(r, match.fNext == (match ? gTests[i].fInput + 1 : nullptr));
138 if (match) {
139 REPORTER_ASSERT(r, *match == gTests[i].fMatchValue);
157 const auto m = Opt<LIT<'f', 'o', 'o'>>::Match(gTests[i].fInput);
164 REPORTER_ASSERT(r, (Seq<LIT<'X'>, EOS>::Match("X")));
165 REPORTER_ASSERT(r, !(Seq<LIT<'X'>, EOS>::Match("x")));
166 REPORTER_ASSERT(r, !(Seq<LIT<'X'>, EOS>::Match("xX")));
167 REPORTER_ASSERT(r, !(Seq<LIT<'X'>, EOS>::Match("XX")));
168 REPORTER_ASSERT(r, (Seq<LIT<'X'>, Seq<LIT<'X'>, EOS>>::Match("XX")));
169 REPORTER_ASSERT(r, (Seq<LIT<'X'>, Seq<LIT<'X'>, EOS>>::Match("XX")));
171 REPORTER_ASSERT(r, !(Seq<LIT<'F', 'o', 'o'>, EOS>::Match("FooBar")));
172 REPORTER_ASSERT(r, (Seq<LIT<'F', 'o', 'o'>, EOS>::Match("Foo")));
175 const auto m = Seq<LIT<'x'>, Digit>::Match("x5");
180 const auto m = Seq<Digit, Digit>::Match("42");
188 REPORTER_ASSERT(r, !(Choice<Digit,Alpha>::Match("")));
189 REPORTER_ASSERT(r, !(Choice<Digit,Alpha>::Match("\t")));
190 REPORTER_ASSERT(r, !(Choice<Digit,Alpha>::Match(" ")));
191 REPORTER_ASSERT(r, (Choice<Digit,Alpha>::Match("a")));
192 REPORTER_ASSERT(r, (Choice<Digit,Alpha>::Match("3")));
193 REPORTER_ASSERT(r, (Choice<Digit,Alpha>::Match("a ")));
194 REPORTER_ASSERT(r, (Choice<Digit,Alpha>::Match("3 ")));
195 REPORTER_ASSERT(r, !(Choice<Digit,Alpha>::Match(" a ")));
196 REPORTER_ASSERT(r, !(Choice<Digit,Alpha>::Match(" 3 ")));
199 const auto m = Choice<Alpha, Digit>::Match("x");
207 const auto m = Choice<Alpha, Digit>::Match("7");
228 const auto matchAny = Any<LIT<'f', 'o', 'o'>>::Match(gTests[i].fInput);
232 const auto matchSome = Some<LIT<'f', 'o', 'o'>>::Match(gTests[i].fInput);
239 const auto m = Any<Digit>::Match("0123456789foo");
258 REPORTER_ASSERT(r, !P0::Match(""));
259 REPORTER_ASSERT(r, !P0::Match(","));
260 REPORTER_ASSERT(r, !P0::Match("1,"));
261 REPORTER_ASSERT(r, !P0::Match(",1"));
262 REPORTER_ASSERT(r, P0::Match("1"));
263 REPORTER_ASSERT(r, P0::Match("1,2"));
264 REPORTER_ASSERT(r, !P0::Match("1,2 "));
265 REPORTER_ASSERT(r, P0::Match("123,456"));
281 REPORTER_ASSERT(r, !P1::Match(""));
282 REPORTER_ASSERT(r, !P1::Match("FooBar"));
283 REPORTER_ASSERT(r, !P1::Match("FooBaz"));
284 REPORTER_ASSERT(r, P1::Match("FooBarBaz"));
285 REPORTER_ASSERT(r, P1::Match("foobarbaz"));
286 REPORTER_ASSERT(r, P1::Match(" FooBarbaz "));
287 REPORTER_ASSERT(r, P1::Match(" FooBarbarbarBaz "));