mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
@@ -1251,7 +1251,7 @@ struct Coord {
|
||||
z int
|
||||
}
|
||||
|
||||
fn test__array_struct_contains() {
|
||||
fn test_array_struct_contains() {
|
||||
mut coords := []Coord{}
|
||||
coord_1 := Coord{
|
||||
x: 1
|
||||
@@ -1265,3 +1265,16 @@ fn test__array_struct_contains() {
|
||||
assert exists == true
|
||||
assert not_exists == false
|
||||
}
|
||||
|
||||
fn test_array_struct_ref_contains() {
|
||||
mut coords := []&Coord{}
|
||||
coord_1 := &Coord{
|
||||
x: 1
|
||||
y: 2
|
||||
z: -1
|
||||
}
|
||||
coords << coord_1
|
||||
exists := coord_1 in coords
|
||||
println(exists)
|
||||
assert exists == true
|
||||
}
|
||||
|
Reference in New Issue
Block a user