1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix gen_array_equality_fn() (#7633)

This commit is contained in:
yuyi
2020-12-28 18:26:50 +08:00
committed by GitHub
parent 164dd3000b
commit 07459a77e3
4 changed files with 42 additions and 25 deletions

View File

@ -0,0 +1,12 @@
struct User {
age int
name string
}
fn test_eq() {
assert [5, 6, 7] != [6, 7]
assert [`a`, `b`] == [`a`, `b`]
assert [User{age: 22, name: 'bob'}] == [User{age: 22, name: 'bob'}]
assert [{'bob': 22}, {'tom': 33}] == [{'bob': 22}, {'tom': 33}]
assert [[1, 2, 3], [4]] == [[1, 2, 3], [4]]
}