From 8f17815ca8bc9566f8746d76895becbbe3a33301 Mon Sep 17 00:00:00 2001 From: Clint Herron Date: Fri, 12 Apr 2024 16:49:05 -0400 Subject: [PATCH] Add slightly more complex grammar with quantifiers to test references with quantifiers. --- tests/test-grammar-integration.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test-grammar-integration.cpp b/tests/test-grammar-integration.cpp index f6ec82587..28e8992d3 100644 --- a/tests/test-grammar-integration.cpp +++ b/tests/test-grammar-integration.cpp @@ -216,6 +216,30 @@ static void test_quantifiers() { "aa", "ba", } + }, + { + // Grammar + R"""( +root ::= cons+ vowel* cons? (vowel cons)* +vowel ::= [aeiouy] +cons ::= [bcdfghjklmnpqrstvwxyz] +)""", + // Passing strings + { + "yes", + "no", + "noyes", + "crwth", + "four", + "bryyyy", + }, + // Failing strings + { + "yess", + "yesno", + "forty", + "catyyy", + } } };