Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
options
/
option_selector_fn_none_test.v
13
lines
·
11
sloc
·
170 bytes
·
a200c4540a5bac23f9ef5f308a2e0c079c54e12c
Raw
1
struct
Foo {
2
mut
:
3
func ?
fn
(voidptr) ?bool
4
}
5
6
fn
callback(foo &Foo) ?bool {
7
return
foo.func? == callback
8
}
9
10
fn
test_main() {
11
t := Foo{}
12
assert callback(&t) ==
none
13
}
14