mirror of
https://github.com/vlang/v.git
synced 2025-09-16 16:02:29 +03:00
checker: do not allow arr1=arr2 without cloning
This commit is contained in:
parent
583c02316a
commit
6bf21c300a
5 changed files with 8 additions and 7 deletions
|
@ -359,6 +359,7 @@ fn test_clone() {
|
|||
assert nums.slice(1, 3).str() == '[2, 3]'
|
||||
}
|
||||
|
||||
/*
|
||||
fn test_copy() {
|
||||
a := [1, 2, 3]
|
||||
b := a
|
||||
|
@ -366,7 +367,7 @@ fn test_copy() {
|
|||
assert b[1] == 2
|
||||
assert b[2] == 3
|
||||
}
|
||||
|
||||
*/
|
||||
fn test_mutli_array_clone() {
|
||||
// 2d array_int
|
||||
mut a2_1 := [[1, 2, 3], [4, 5, 6]]
|
||||
|
@ -683,7 +684,7 @@ fn test_array_str() {
|
|||
numbers := [1, 2, 3]
|
||||
assert numbers == [1, 2, 3]
|
||||
numbers2 := [numbers, [4, 5, 6]] // dup str() bug
|
||||
_ = numbers2
|
||||
println(numbers2)
|
||||
assert true
|
||||
assert numbers.str() == '[1, 2, 3]'
|
||||
// QTODO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue