mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
compiler: allow to declare global variables in multiple files
Traverse and count globals across all used files. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
babd84ec10
commit
7009417325
6 changed files with 36 additions and 8 deletions
|
@ -127,3 +127,12 @@ func TestContractWithNoMain(t *testing.T) {
|
|||
require.Equal(t, 1, v.Estack().Len())
|
||||
require.Equal(t, big.NewInt(42), v.PopResult())
|
||||
}
|
||||
|
||||
func TestMultipleFiles(t *testing.T) {
|
||||
src := `package foo
|
||||
import "github.com/nspcc-dev/neo-go/pkg/compiler/testdata/multi"
|
||||
func Main() int {
|
||||
return multi.Sum()
|
||||
}`
|
||||
eval(t, src, big.NewInt(42))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue