Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
structs
/
default_expr_array_init_test.v
15
lines
·
13
sloc
·
224 bytes
·
a3665820109cbaa92111a6c35704397e4bce3004
Raw
1
struct
Foo {
2
pub
mut
:
3
integer_range_for_discrete []int = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
4
}
5
6
fn
foo(a string) Foo {
7
return
match
a {
8
'a'
{ Foo{} }
9
else
{ panic(
'foo'
) }
10
}
11
}
12
13
fn
test_main() {
14
assert foo(
'a'
) == Foo{}
15
}
16