mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
sort: fix sorting by struct fields
This commit is contained in:
@@ -736,6 +736,9 @@ fn test_sort() {
|
||||
assert(users[0].age == 25)
|
||||
assert(users[1].age == 22)
|
||||
assert(users[2].age == 20)
|
||||
//
|
||||
users.sort(a.name < b.name) // Test sorting by string fields
|
||||
//assert users.map(it.name).join(' ') == 'Alice Bob Peter'
|
||||
}
|
||||
|
||||
fn test_f32_sort() {
|
||||
|
Reference in New Issue
Block a user