v.parser: do not treat test_ functions specially outside of _test.v files

pull/10399/head
Delyan Angelov 2021-06-08 23:01:49 +03:00
parent 000790b112
commit 3dc4d13160
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 2 additions and 1 deletions

View File

@ -341,7 +341,8 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
end_pos := p.prev_tok.position() end_pos := p.prev_tok.position()
short_fn_name := name short_fn_name := name
is_main := short_fn_name == 'main' && p.mod == 'main' 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 // Register
if is_method { if is_method {