Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.79k
stars
2.16k
forks
source link
cannot use or test a generic function via submodule #5508
import math.stats
fn test_freq() {
// Tests were also verified on Wolfram Alpha
data := [f64(10.0), 10.0, 5.9, 2.7]
mut o := math.stats.freq<f64>(data, 10.0)
assert o == 2
o = math.stats.freq<f64>(data, 2.7)
assert o == 1
o = math.stats.freq<f64>(data, 15)
assert o == 0
}
v test file_test.v
What did you expect to see?
Tests failing or successful
What did you see instead?
------------------------------------------------------------------------------------ Testing... -----------------------------------------------------------------------------------FAIL 109.375 ms vlib/math/stats/stats_test.v
vlib/math/stats/stats_test.v:7:36: error: unexpected `,`, expecting `)`
5 | // Tests were also verified on Wolfram Alpha
6 | data := [f64(10.0), 10.0, 5.9, 2.7]
7 | mut o := math.stats.freq<f64>(data, 10.0)
| ^
8 | assert o == 2
9 | o = math.stats.freq<f64>(data, 2.7)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 116.376 ms <=== total time spent running V _test.v files
ok, fail, skip, total = 0, 1, 0, 1
V version: Latest
OS: WSL
What did you do?
v test file_test.v
What did you expect to see? Tests failing or successful
What did you see instead?