mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
15 lines
265 B
V
15 lines
265 B
V
fn include[T](a T, b []T) bool {
|
|
return a in b
|
|
}
|
|
|
|
fn test_generics_multi_array_in() {
|
|
println(include(1, [1]))
|
|
assert include(1, [1])
|
|
|
|
println(include([1], [[1]]))
|
|
assert include([1], [[1]])
|
|
|
|
println(include([[1]], [[[1]]]))
|
|
assert include([[1]], [[[1]]])
|
|
}
|