mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
all: minor array fixes
This commit is contained in:
parent
3c210a57f9
commit
50a6976b5e
12 changed files with 357 additions and 417 deletions
|
@ -5,14 +5,14 @@ const (
|
|||
)
|
||||
|
||||
fn test_sorting_simple() {
|
||||
mut a := unsorted
|
||||
mut a := unsorted.clone()
|
||||
a.sort()
|
||||
eprintln(' a: $a')
|
||||
assert a == sorted_asc
|
||||
}
|
||||
|
||||
fn test_sorting_with_condition_expression() {
|
||||
mut a := unsorted
|
||||
mut a := unsorted.clone()
|
||||
a.sort(a > b)
|
||||
eprintln(' a: $a')
|
||||
assert a == sorted_desc
|
||||
|
@ -23,7 +23,7 @@ fn mysort(mut a []int) {
|
|||
}
|
||||
|
||||
fn test_sorting_by_passing_a_mut_array_to_a_function() {
|
||||
mut a := unsorted
|
||||
mut a := unsorted.clone()
|
||||
mysort(mut a)
|
||||
eprintln(' a: $a')
|
||||
assert a == sorted_asc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue