From 3dc4d13160f186937e0de62f944b6df375339902 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 8 Jun 2021 23:01:49 +0300 Subject: [PATCH] v.parser: do not treat test_ functions specially outside of _test.v files --- vlib/v/parser/fn.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index 749d304a67..7c099849a4 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -341,7 +341,8 @@ fn (mut p Parser) fn_decl() ast.FnDecl { end_pos := p.prev_tok.position() short_fn_name := name is_main := short_fn_name == 'main' && p.mod == 'main' - is_test := short_fn_name.starts_with('test_') || short_fn_name.starts_with('testsuite_') + mut is_test := (short_fn_name.starts_with('test_') || short_fn_name.starts_with('testsuite_')) + && (p.file_base.ends_with('_test.v') || p.file_base.ends_with('_test.vv')) // Register if is_method {