v2 / vlib / v / tests / enums / enum_array_init_test.v
9 lines · 8 sloc · 144 bytes · 90cef28dfa69668bc12303961676554326e9ba66
Raw
1enum Enum {
2 thing = 10
3}
4
5fn test_enum_array_init() {
6 x := []Enum{len: 10, init: .thing}
7 assert x[0] == .thing
8 assert x.all(it == .thing)
9}
10