Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
builtin_arrays
/
fixed_array_explicit_decompose_test.v
12
lines
·
11
sloc
·
183 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
fn
sum(a ...int) int {
2
mut
total := 0
3
for
x
in
a {
4
total += x
5
}
6
return
total
7
}
8
9
fn
test_fixed_array_explicit_decompose() {
10
arr := [1, 2, 3, 4]!
11
assert sum(...arr[..]) == 10
12
}
13