Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
options
/
option_if_expr_test.v
16
lines
·
15
sloc
·
176 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
fn
f() ?int {
2
return
none
3
}
4
5
fn
test_option_if_expr() {
6
i := f()
or
{
7
if
err is
none
{
8
int(0)
9
}
else
{
10
eprintln(err)
11
int(-1)
12
}
13
}
14
println(i)
15
assert i == 0
16
}
17