mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: remove unnecessary v_printf test
This commit is contained in:
parent
47e10a9fcd
commit
f1e9a8ff37
@ -3,7 +3,7 @@
|
|||||||
These are v implementations of the C language `printf` and `sprintf` functions.
|
These are v implementations of the C language `printf` and `sprintf` functions.
|
||||||
|
|
||||||
> **Note**
|
> **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
|
### v_sprintf
|
||||||
|
|
||||||
|
@ -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,
|
p.file_display_path = os.real_path(p.file_name).replace_once(parser.normalised_working_folder,
|
||||||
'').replace('\\', '/')
|
'').replace('\\', '/')
|
||||||
p.inside_vlib_file = p.file_name_dir.contains('vlib')
|
p.inside_vlib_file = p.file_name_dir.contains('vlib')
|
||||||
p.inside_test_file = p.file_base.ends_with('_test.v')
|
p.inside_test_file = p.file_base.ends_with('_test.v') || p.file_base.ends_with('_test.vv')
|
||||||
|| p.file_base.ends_with('_test.vv')
|
|
||||||
|| p.file_base.all_before_last('.v').all_before_last('.').ends_with('_test')
|
|| 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)
|
hash := fnv1a.sum64_string(path)
|
||||||
p.unique_prefix = hash.hex_full()
|
p.unique_prefix = hash.hex_full()
|
||||||
|
@ -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}')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user