1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/tests/match_interface_test.v
2021-02-22 14:55:43 +02:00

13 lines
259 B
V

interface Animal { name string }
struct Dog { name string }
struct Cat { name string }
fn test_interface_match() {
a := Animal(Dog{name: 'Jet'})
match a {
Dog { assert true }
Cat { assert false }
else { assert false }
}
}