v2 / vlib / v / tests / builtin_arrays / array_of_alias_pop_test.v
17 lines · 15 sloc · 299 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1@[heap]
2struct Attribute {
3mut:
4 name string
5 value string
6}
7
8type AttributeStack = []&Attribute
9
10fn test_array_of_alias_pop() {
11 mut stack := AttributeStack([]&Attribute{})
12 stack << &Attribute{'foo', 'bar'}
13 ret := stack.pop()
14 println(ret)
15 assert ret.name == 'foo'
16 assert ret.value == 'bar'
17}
18