1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: better ternary concat wrapping (#8379)

This commit is contained in:
Lukas Neubert
2021-01-28 11:23:48 +01:00
committed by GitHub
parent d86cb67eda
commit 75d85403a6
12 changed files with 48 additions and 24 deletions

View File

@ -387,16 +387,22 @@ fn test_mutli_array_clone() {
mut a3_2 := a3_1.clone()
a3_1[0][0][1] = 0
a3_2[0][1][0] = 0
assert a3_1 == [[[1, 0], [2, 2], [3, 3]], [[4, 4], [5, 5], [6, 6]]]
assert a3_2 == [[[1, 1], [0, 2], [3, 3]], [[4, 4], [5, 5], [6, 6]]]
assert a3_1 == [[[1, 0], [2, 2], [3, 3]], [[4, 4], [5, 5],
[6, 6],
]]
assert a3_2 == [[[1, 1], [0, 2], [3, 3]], [[4, 4], [5, 5],
[6, 6],
]]
// 3d array_string
mut b3_1 := [[['1', '1'], ['2', '2'], ['3', '3']], [['4', '4'],
['5', '5'], ['6', '6']]]
mut b3_2 := b3_1.clone()
b3_1[0][0][1] = '0'
b3_2[0][1][0] = '0'
assert b3_1 == [[['1', '0'], ['2', '2'], ['3', '3']], [['4', '4'], ['5', '5'], ['6', '6']]]
assert b3_2 == [[['1', '1'], ['0', '2'], ['3', '3']], [['4', '4'], ['5', '5'], ['6', '6']]]
assert b3_1 == [[['1', '0'], ['2', '2'], ['3', '3']], [['4', '4'],
['5', '5'], ['6', '6']]]
assert b3_2 == [[['1', '1'], ['0', '2'], ['3', '3']], [['4', '4'],
['5', '5'], ['6', '6']]]
}
fn test_doubling() {