Skip to content

Commit c043814

Browse files
committed
Add slightly more complex grammar with quantifiers to test references with quantifiers.
1 parent 09e599a commit c043814

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test-grammar-integration.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,30 @@ static void test_quantifiers() {
216216
"aa",
217217
"ba",
218218
}
219+
},
220+
{
221+
// Grammar
222+
R"""(
223+
root ::= cons+ vowel* cons? (vowel cons)*
224+
vowel ::= [aeiouy]
225+
cons ::= [bcdfghjklmnpqrstvwxyz]
226+
)""",
227+
// Passing strings
228+
{
229+
"yes",
230+
"no",
231+
"noyes",
232+
"crwth",
233+
"four",
234+
"bryyyy",
235+
},
236+
// Failing strings
237+
{
238+
"yess",
239+
"yesno",
240+
"forty",
241+
"catyyy",
242+
}
219243
}
220244
};
221245

0 commit comments

Comments
 (0)