Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
comptime
/
comptime_option_field_test.v
18
lines
·
17
sloc
·
229 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
struct
Test {
2
a ?int
3
b ?f64
4
c ?string
5
d int
6
e f64
7
f string
8
}
9
10
fn
test_option_comptime() {
11
mut
opts := []string{}
12
$
for
f
in
Test.fields {
13
$
if
f.typ is $option {
14
opts << f.name
15
}
16
}
17
assert opts == [
'a'
,
'b'
,
'c'
]
18
}
19