From f1e9a8ff3712c5d6eae1ae0d89edde5c35ad9c2a Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 19 Mar 2023 15:30:52 +0300 Subject: [PATCH] tests: remove unnecessary v_printf test --- vlib/strconv/format.md | 2 +- vlib/v/parser/parser.v | 4 +-- vlib/v/slow_tests/inout/strconv_v_printf.vv | 40 --------------------- 3 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 vlib/v/slow_tests/inout/strconv_v_printf.vv diff --git a/vlib/strconv/format.md b/vlib/strconv/format.md index bf324d47c6..e577fb89db 100644 --- a/vlib/strconv/format.md +++ b/vlib/strconv/format.md @@ -3,7 +3,7 @@ These are v implementations of the C language `printf` and `sprintf` functions. > **Note** -> These functions are platform dependent in C, but in V they are platform independent. +> These functions are deprecated and will be removed soon. Use string interpolation instead. ### v_sprintf diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 9fbabcc758..96523b10a4 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -193,10 +193,8 @@ 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() diff --git a/vlib/v/slow_tests/inout/strconv_v_printf.vv b/vlib/v/slow_tests/inout/strconv_v_printf.vv deleted file mode 100644 index 3d183e42b9..0000000000 --- a/vlib/v/slow_tests/inout/strconv_v_printf.vv +++ /dev/null @@ -1,40 +0,0 @@ -import strconv - -const limit = 201 - -fn main() { - // sieve - mut c := [limit]bool{} - c[1] = true - - mut p := 2 - for { - p2 := p * p - if p2 >= limit { - break - } - - for i := p2; i < limit; i += p { - c[i] = true - } - - for { - p++ - if !c[p] { - break - } - } - } - - // sieve complete. now print a representation. - for n in 1 .. limit { - if c[n] { - print(' .') - } else { - strconv.v_printf('%3d', n) - } - if n % 20 == 0 { - println('iter: ${n}') - } - } -}