compiler: emit byte constants properly
This commit is contained in:
parent
98c508d361
commit
b4f1142149
2 changed files with 12 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue