Skip to content

Commit

Permalink
improve fixed_array_sort_test.v
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Oct 31, 2024
1 parent 3807f38 commit 210705a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vlib/builtin/fixed_array_sort_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ fn test_sorted_with_compare_1() {
}
return 0
})
assert a == ['hi', '1', '5', '3']!
assert b == ['1', '3', '5', 'hi']!
}

Expand Down Expand Up @@ -149,6 +150,13 @@ fn test_sorted_with_compare_2() {
return compare_strings(a.s, b.s)
}
b := arr.sorted_with_compare(cmp)
assert arr[0].s == 'bbb'
assert arr[0].i == 100
assert arr[1].s == 'aaa'
assert arr[1].i == 101
assert arr[2].s == 'ccc'
assert arr[2].i == 102

assert b[0].s == 'aaa'
assert b[0].i == 101
assert b[1].s == 'bbb'
Expand Down

0 comments on commit 210705a

Please sign in to comment.