Skip to content

Commit 60b3f99

Browse files
committed
add tests
1 parent 2f833f3 commit 60b3f99

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/tests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,6 +3529,13 @@ TEST(GrammarFactoryHelperTest, LongestCommonPrefix) {
35293529
EXPECT_EQ(prefix, expected);
35303530
}
35313531

3532+
TEST(GrammarFactoryHelperTest, StartsWithReturnsFalseWhenProdIsShorterThanPrefix) {
3533+
GrammarFactory factory;
3534+
production prod{"a", "b"};
3535+
EXPECT_FALSE(factory.StartsWith(prod, {"a", "b", "c"}));
3536+
EXPECT_FALSE(factory.StartsWith(prod, {"a", "c", "b"}));
3537+
}
3538+
35323539
TEST(GrammarFactoryHelperTest, StartsWithAndGenerateNonTerminal) {
35333540
GrammarFactory factory;
35343541
production prod{"a", "b", "c"};

0 commit comments

Comments
 (0)