summaryrefslogtreecommitdiff
path: root/test/test_match.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_match.c')
-rw-r--r--test/test_match.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_match.c b/test/test_match.c
index 17edba4..b601a4d 100644
--- a/test/test_match.c
+++ b/test/test_match.c
@@ -131,6 +131,18 @@ TEST score_dot() {
PASS();
}
+TEST score_long_string() {
+ char string[4096];
+ memset(string, 'a', sizeof(string) - 1);
+ string[sizeof(string) - 1] = '\0';
+
+ ASSERT_SCORE_EQ(SCORE_MIN, match("aa", string));
+ ASSERT_SCORE_EQ(SCORE_MIN, match(string, "aa"));
+ ASSERT_SCORE_EQ(SCORE_MIN, match(string, string));
+
+ PASS();
+}
+
TEST positions_consecutive() {
size_t positions[3];
match_positions("amo", "app/models/foo", positions);
@@ -210,6 +222,7 @@ SUITE(match_suite) {
RUN_TEST(score_slash);
RUN_TEST(score_capital);
RUN_TEST(score_dot);
+ RUN_TEST(score_long_string);
RUN_TEST(positions_consecutive);
RUN_TEST(positions_start_of_word);