mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
arrays: add a generic arrays.concat(os.args,'abc','xyz')
function (#11985)
This commit is contained in:
parent
4c01627e00
commit
09dfc3f301
2 changed files with 24 additions and 0 deletions
|
@ -180,3 +180,17 @@ fn test_group_by() {
|
|||
return 0
|
||||
}) == map[int][]int{}
|
||||
}
|
||||
|
||||
fn test_concat_int() {
|
||||
mut a := [1, 2, 3]
|
||||
mut b := [3, 2, 1]
|
||||
|
||||
assert concat(a, ...b) == [1, 2, 3, 3, 2, 1]
|
||||
}
|
||||
|
||||
fn test_concat_string() {
|
||||
mut a := ['1', '2', '3']
|
||||
mut b := ['3', '2', '1']
|
||||
|
||||
assert concat(a, ...b) == ['1', '2', '3', '3', '2', '1']
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue