ret = -1;
}
- if (ret == 0 && hash_table_count(filter->stopwords) == 0)
- i_warning("Stopwords list \"%s\" seems empty. Is the file correctly formatted?", path);
+ if (ret == 0 && hash_table_count(filter->stopwords) == 0) {
+ *error_r = t_strdup_printf("Stopwords list \"%s\" seems empty. "
+ "Is the file correctly formatted?",
+ path);
+ ret = -1;
+ }
i_stream_destroy(&input);
return ret;
test_begin("fts filter stopwords, malformed list");
test_assert(fts_filter_create(fts_filter_stopwords, NULL, &malformed, stopword_settings, &filter, &error) == 0);
- test_expect_error_string("seems empty. Is the file correctly formatted?");
- test_assert(fts_filter_filter(filter, &token, &error) > 0);
+ test_assert(fts_filter_filter(filter, &token, &error) < 0);
+ test_assert(strstr(error, "seems empty. Is the file correctly formatted?") != NULL);
test_expect_no_more_errors();
fts_filter_unref(&filter);
test_end();