-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgen: fix dump fixed array on array append
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
vlib/v/tests/builtin_arrays/dump_fixed_array_on_array_append_test.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
fn test_dump_fixed_array_on_array_append() { | ||
mut myarr := [][3]u8{} | ||
myarr << [u8(1), 2, 3]! | ||
myarr << [u8(4), 5, 6]! | ||
myarr << [u8(7), 8, 9]! | ||
println(myarr) | ||
assert myarr[0] == [u8(1), 2, 3]! | ||
assert myarr[1] == [u8(4), 5, 6]! | ||
assert myarr[2] == [u8(7), 8, 9]! | ||
|
||
mut myarr2 := [][3]u8{} | ||
myarr2 << dump([u8(1), 2, 3]!) | ||
myarr2 << dump([u8(4), 5, 6]!) | ||
myarr2 << dump([u8(7), 8, 9]!) | ||
println(myarr2) | ||
assert myarr2[0] == [u8(1), 2, 3]! | ||
assert myarr2[1] == [u8(4), 5, 6]! | ||
assert myarr2[2] == [u8(7), 8, 9]! | ||
} |