mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
parent
07459a77e3
commit
d46b930c71
2 changed files with 29 additions and 23 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue