mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
compiler: add a test for inlined selector statements
Selector here is either a struct field access or global package variable/constant. While technically none of these require an additional local, inlining actually uses one, so add a test for it.
This commit is contained in:
parent
21a7f3d760
commit
7e9f8e03c2
1 changed files with 10 additions and 0 deletions
|
@ -264,3 +264,13 @@ func TestInlineConversionQualified(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, b2, b1)
|
require.Equal(t, b2, b1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPackageVarsInInlinedCalls(t *testing.T) {
|
||||||
|
src := `package foo
|
||||||
|
import "github.com/nspcc-dev/neo-go/pkg/compiler/testdata/inline"
|
||||||
|
import "github.com/nspcc-dev/neo-go/pkg/compiler/testdata/inline/b"
|
||||||
|
func Main() int {
|
||||||
|
return inline.Sum(inline.A, b.A)
|
||||||
|
}`
|
||||||
|
eval(t, src, big.NewInt(13))
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue