authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-01-21 09:48:57+01:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-01-21 09:48:57+01:00
logfc5ae1c4096fa814b97671525db17c0b4f0b786d
tree6800428bfd60e844b70c5a4e77b1b34a7dc6548c
parentd5b0a963d1bf3399e3d8b63b03ea61f7d771adbd

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.

1 files changed, 2 insertions(+), 1 deletions(-)

src/stage1/analyze.cpp+2-1
...@@ -3875,7 +3875,8 @@ static void preview_test_decl(CodeGen *g, AstNode *node, ScopeDecls *decls_scope...@@ -3875,7 +3875,8 @@ static void preview_test_decl(CodeGen *g, AstNode *node, ScopeDecls *decls_scope
3875 Buf *test_name = g->test_name_prefix ?3875 Buf *test_name = g->test_name_prefix ?
3876 buf_sprintf("%s%s", buf_ptr(g->test_name_prefix), buf_ptr(decl_name_buf)) : decl_name_buf;3876 buf_sprintf("%s%s", buf_ptr(g->test_name_prefix), buf_ptr(decl_name_buf)) : decl_name_buf;
38773877
3878 if (g->test_filter != nullptr && strstr(buf_ptr(test_name), buf_ptr(g->test_filter)) == nullptr) {3878 if (g->test_filter != nullptr && buf_len(test_name) > 0 &&
3879 strstr(buf_ptr(test_name), buf_ptr(g->test_filter)) == nullptr) {
3879 return;3880 return;
3880 }3881 }
38813882