forked from TrueCloudLab/neoneo-go
19 lines
280 B
Go
19 lines
280 B
Go
|
package compiler_test
|
||
|
|
||
|
import (
|
||
|
"math/big"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestAddressOfLiteral(t *testing.T) {
|
||
|
src := `package foo
|
||
|
type Foo struct { A int }
|
||
|
func Main() int {
|
||
|
f := &Foo{}
|
||
|
setA(f, 3)
|
||
|
return f.A
|
||
|
}
|
||
|
func setA(s *Foo, a int) { s.A = a }`
|
||
|
eval(t, src, big.NewInt(3))
|
||
|
}
|