Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
enums
/
enum_custom_static_from_string_test.v
14
lines
·
12
sloc
·
197 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
enum
Color {
2
red
3
green
4
blue
5
}
6
7
fn
Color.from_string(x string) Color {
8
return
Color.red
9
}
10
11
fn
test_enum_custom_static_from_string() {
12
ret := Color.from_string(
'abc'
)
13
assert ret == Color.red
14
}
15