mirror of
https://github.com/ziglang/zig.git
synced 2026-01-12 02:15:12 +00:00
stage1: don't filter test blocks with empty label
The common pattern of including a file containing all the tests in a empty-label test block breaks down when using --test-filter.
This commit is contained in:
parent
d5b0a963d1
commit
fc5ae1c409
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user