v2 / vlib / v / tests / concurrency / spawn_array_mut_test.v
14 lines · 13 sloc · 186 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1fn mutable_array_arg(mut a []int) {
2 println(a)
3 a << 4
4 assert a.len == 4
5}
6
7fn test_main() {
8 mut a := []int{}
9 a << 1
10 a << 2
11 a << 3
12 w := spawn mutable_array_arg(mut a)
13 w.wait()
14}
15