diff --git a/src/stage1/analyze.cpp b/src/stage1/analyze.cpp index 5f86321e9d356554f47e27a77ba4e54dac3314a1..a98bd28bb6d679ee6897ddcd6e1c787ccf7a0dae 100644 --- a/src/stage1/analyze.cpp +++ b/src/stage1/analyze.cpp @@ -3875,7 +3875,8 @@ static void preview_test_decl(CodeGen *g, AstNode *node, ScopeDecls *decls_scope Buf *test_name = g->test_name_prefix ? buf_sprintf("%s%s", buf_ptr(g->test_name_prefix), buf_ptr(decl_name_buf)) : decl_name_buf; - if (g->test_filter != nullptr && strstr(buf_ptr(test_name), buf_ptr(g->test_filter)) == nullptr) { + if (g->test_filter != nullptr && buf_len(test_name) > 0 && + strstr(buf_ptr(test_name), buf_ptr(g->test_filter)) == nullptr) { return; }