Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
structs
/
struct_field_array_index_test.v
17
lines
·
13
sloc
·
235 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
struct
App {
2
mut
:
3
buffer []string
4
}
5
6
fn
test_struct_field_array_index() {
7
mut
app := &App{
8
buffer: []string{len: 2}
9
}
10
11
app.buffer[0] +=
'hello'
12
app.buffer[1] +=
'world'
13
14
println(app)
15
16
assert app.buffer == [
'hello'
,
'world'
]
17
}
18