sort: fix sorting by struct fields

This commit is contained in:
Alexander Medvednikov 2020-08-12 18:43:41 +02:00
parent e5e31f7210
commit f8be2110ec
3 changed files with 69 additions and 15 deletions

View file

@ -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() {