mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
compiler: allow to append multiple elements
This commit is contained in:
parent
76925fe3e0
commit
bc1d6791b9
2 changed files with 43 additions and 12 deletions
|
@ -151,6 +151,33 @@ var sliceTestCases = []testCase{
|
|||
}`,
|
||||
[]byte{1, 2},
|
||||
},
|
||||
{
|
||||
"append multiple bytes to a slice",
|
||||
`package foo
|
||||
func Main() []byte {
|
||||
var a []byte
|
||||
a = append(a, 1, 2)
|
||||
return a
|
||||
}`,
|
||||
[]byte{1, 2},
|
||||
},
|
||||
{
|
||||
"append multiple ints to a slice",
|
||||
`package foo
|
||||
func Main() []int {
|
||||
var a []int
|
||||
a = append(a, 1, 2, 3)
|
||||
a = append(a, 4, 5)
|
||||
return a
|
||||
}`,
|
||||
[]stackitem.Item{
|
||||
stackitem.NewBigInteger(big.NewInt(1)),
|
||||
stackitem.NewBigInteger(big.NewInt(2)),
|
||||
stackitem.NewBigInteger(big.NewInt(3)),
|
||||
stackitem.NewBigInteger(big.NewInt(4)),
|
||||
stackitem.NewBigInteger(big.NewInt(5)),
|
||||
},
|
||||
},
|
||||
{
|
||||
"declare compound slice",
|
||||
`package foo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue