From 47e10a9fcd4d5ce73328b7e0fe649f4b5618756d Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 19 Mar 2023 15:03:49 +0300 Subject: [PATCH] strconv: make v_printf private --- vlib/strconv/vprintf.c.v | 3 ++- vlib/v/parser/parser.v | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vlib/strconv/vprintf.c.v b/vlib/strconv/vprintf.c.v index a66ec20a4a..b3565e7a57 100644 --- a/vlib/strconv/vprintf.c.v +++ b/vlib/strconv/vprintf.c.v @@ -24,7 +24,7 @@ enum Char_parse_state { // v_printf prints a sprintf-like formated `string` to the terminal. [deprecated: 'use string interpolation instead'] -pub fn v_printf(str string, pt ...voidptr) { +fn v_printf(str string, pt ...voidptr) { print(v_sprintf(str, ...pt)) } @@ -36,6 +36,7 @@ pub fn v_printf(str string, pt ...voidptr) { // assert strconv.v_sprintf('aaa %G', x) == 'aaa 3.141516' // ``` [deprecated: 'use string interpolation instead'] +[deprecated_after: '2023-06-30'] [direct_array_access; manualfree] pub fn v_sprintf(str string, pt ...voidptr) string { mut res := strings.new_builder(pt.len * 16) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 96523b10a4..9fbabcc758 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -193,8 +193,10 @@ pub fn (mut p Parser) set_path(path string) { p.file_display_path = os.real_path(p.file_name).replace_once(parser.normalised_working_folder, '').replace('\\', '/') p.inside_vlib_file = p.file_name_dir.contains('vlib') - p.inside_test_file = p.file_base.ends_with('_test.v') || p.file_base.ends_with('_test.vv') + p.inside_test_file = p.file_base.ends_with('_test.v') + || p.file_base.ends_with('_test.vv') || p.file_base.all_before_last('.v').all_before_last('.').ends_with('_test') + || (p.file_name_dir.contains('vlib/v/slow_tests/inout/') && p.file_base.ends_with('.vv')) hash := fnv1a.sum64_string(path) p.unique_prefix = hash.hex_full()