v2 / vlib / v / tests / builtin_arrays / fixed_array_of_fn_test.v
9 lines · 8 sloc · 145 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1fn foo(a string) int {
2 return 10 + a.len
3}
4
5fn test_fixed_array_fn_index() {
6 a := [foo]!
7 println(a[0]('hello'))
8 assert a[0]('hello') == 15
9}
10