compiler: emit byte constants properly

This commit is contained in:
Evgenii Stratonikov 2020-05-13 10:53:11 +03:00
parent 98c508d361
commit b4f1142149
2 changed files with 12 additions and 4 deletions

View file

@ -36,6 +36,17 @@ func TestShortHandMultiConst(t *testing.T) {
eval(t, src, big.NewInt(6))
}
func TestByteConstant(t *testing.T) {
src := `package foo
import "github.com/nspcc-dev/neo-go/pkg/interop/convert"
const a byte = 0xFF
func Main() int64 {
x := convert.ToInteger(a)
return x+1
}`
eval(t, src, big.NewInt(0x100))
}
func TestGlobalsWithFunctionParams(t *testing.T) {
src := `
package foobar