1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/tests/array_of_alias_pop_test.v

18 lines
298 B
V

[heap]
struct Attribute {
mut:
name string
value string
}
type AttributeStack = []&Attribute
fn test_array_of_alias_pop() {
mut stack := AttributeStack([]&Attribute{})
stack << &Attribute{'foo', 'bar'}
ret := stack.pop()
println(ret)
assert ret.name == 'foo'
assert ret.value == 'bar'
}